What does the method StiReport.CreateReportInNewAppDomain do?
What does the method StiReport.CreateReportInNewAppDomain do?
How do you use CreateReportInNewAppDomain?
How do you use it along with the method StiReport.UnloadReportAppDomain?
I'm hoping it loads/runs the compiled report code in a separate app domain, but I'm still having memory issues.
When I try to use these 2 methods I get the following error:
Type 'Stimulsoft.Report.Dictionary.StiRestrictions' in assembly 'Stimulsoft.Report, Version=2008.2.300.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a' is not marked as serializable.
How do you use it along with the method StiReport.UnloadReportAppDomain?
I'm hoping it loads/runs the compiled report code in a separate app domain, but I'm still having memory issues.
When I try to use these 2 methods I get the following error:
Type 'Stimulsoft.Report.Dictionary.StiRestrictions' in assembly 'Stimulsoft.Report, Version=2008.2.300.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a' is not marked as serializable.
What does the method StiReport.CreateReportInNewAppDomain do?
Hello,
Please don't use this methods. Please visit following link:
http://forum.stimulsoft.com/Default.aspx?g=posts&t=142
In this topic you can read how to avoid memory link.
Thank you.
Please don't use this methods. Please visit following link:
http://forum.stimulsoft.com/Default.aspx?g=posts&t=142
In this topic you can read how to avoid memory link.
Thank you.
What does the method StiReport.CreateReportInNewAppDomain do?
Unfortunately for us, the referred post really isn't an option. We have too many customer generated custom reports to have them all be precompiled on disk. I guess I'll have to figure out a way to create/tear down my own app domain for loading/running stimul reports.
What does the method StiReport.CreateReportInNewAppDomain do?
Hello,
Thank you.
You can do this automatically.Unfortunately for us, the referred post really isn't an option. We have too many customer generated custom reports to have them all be precompiled on disk.
Main problem with app doamin is speed of creation, transfering data (main problem) and transfering rendered report back. Can you say how you get data in report? If you load it from exernal source it have sense.I guess I'll have to figure out a way to create/tear down my own app domain for loading/running stimul reports.
Thank you.
What does the method StiReport.CreateReportInNewAppDomain do?
We pull data from a SQL database for our reports.
Yes it is slower, but it's the only reliable way of preventing dynamic Stimul Reports from hanging on to memory.
So what is the 'automatic' way of achieving app domain goodness?
Yes it is slower, but it's the only reliable way of preventing dynamic Stimul Reports from hanging on to memory.
So what is the 'automatic' way of achieving app domain goodness?
What does the method StiReport.CreateReportInNewAppDomain do?
Hello,
Sorry i can't reproduce problem which you describe in first post. I have used following code:
In any case code of this methods is very simple:
Thank you.
Sorry i can't reproduce problem which you describe in first post. I have used following code:
Code: Select all
DataSet data = new DataSet();
data.ReadXml("D:\\demo.xml");
StiReport report = new StiReport();
report.Load("d:\\simplelist.mrt");
report.RegData(data);
StiReport report2 = report.CreateReportInNewAppDomain();
report2.Show(true);
report.UnloadReportAppDomain();
Code: Select all
internal AppDomain reportDomain = null;
public StiReport CreateReportInNewAppDomain()
{
AppDomainSetup appDomainSetup = new AppDomainSetup();
appDomainSetup.ShadowCopyFiles = "false";
appDomainSetup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
AppDomain appDomain = AppDomain.CreateDomain(StiGuidUtils.NewGuid(), AppDomain.CurrentDomain.Evidence, appDomainSetup);
StiReport report = appDomain.CreateInstanceAndUnwrap(this.GetType().Assembly.FullName, this.GetType().FullName)
as StiReport;
reportDomain = appDomain;
report.LoadFromString(this.SaveToString());
foreach (StiData data in this.DataStore)
{
report.RegData(data.Name, data.Data);
report.DataStore[report.DataStore.Count - 1].ViewData = data.ViewData;
}
return report;
}
public void UnloadReportAppDomain()
{
if (reportDomain != null)
{
AppDomain.Unload(reportDomain);
reportDomain = null;
}
}
What does the method StiReport.CreateReportInNewAppDomain do?
It looks like I was calling CreateReportInNewAppDomain too early. I see I have to call that method just before calling Show (Refresh in my case).
I'll rework my code and let you know how it works.
I'll rework my code and let you know how it works.
What does the method StiReport.CreateReportInNewAppDomain do?
It doesn't seem to work very well.
Here's what I'm doing:
_report is loaded with the stimul report:
If I do the above, I don't get any exported documents, they contain no pages.
If I do this:
(Note I'm trying to use the app domain report, reportInAD, to do the export.)
I receive the following error:
Type 'Stimulsoft.Report.Components.StiPage' in assembly 'Stimulsoft.Report, Version=2008.2.300.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a' is not marked as serializable
Here's what I'm doing:
_report is loaded with the stimul report:
Code: Select all
StiReport reportInAD = _report.CreateReportInNewAppDomain();
reportInAD.Render();
StiPdfExportService exportServicePDF = new StiPdfExportService();
exportServicePDF.ExportPdf( _report, outputFilename );
_report.UnloadReportAppDomain();
If I do this:
Code: Select all
StiReport reportInAD = _report.CreateReportInNewAppDomain();
reportInAD.Render();
StiPdfExportService exportServicePDF = new StiPdfExportService();
exportServicePDF.ExportPdf( reportInAD, outputFilename );
_report.UnloadReportAppDomain();
I receive the following error:
Type 'Stimulsoft.Report.Components.StiPage' in assembly 'Stimulsoft.Report, Version=2008.2.300.0, Culture=neutral, PublicKeyToken=ebe6666cba19647a' is not marked as serializable
What does the method StiReport.CreateReportInNewAppDomain do?
Hello,
Export to Pdf use many native dlls imports. I really can't say how it will be work in other domain. Please try following code:
Thank you.
Export to Pdf use many native dlls imports. I really can't say how it will be work in other domain. Please try following code:
Code: Select all
string str;
StiReport reportInAD = _report.CreateReportInNewAppDomain();
reportInAD.Render();
str = reportInAD.SaveDocumentToString();
_report.UnloadReportAppDomain();
_report.LoadDocumentFromString(str);
_report.ExportDocument(StiExportFormat.Pdf, outputFilename );