Please send your report to support@stimulsoft.com.Mpanal wrote:Tell me an email for send you the report.
Thank you.
Please send your report to support@stimulsoft.com.Mpanal wrote:Tell me an email for send you the report.
SentIvan wrote:Hello,
Please send your report to support@stimulsoft.com.Mpanal wrote:Tell me an email for send you the report.
Thank you.
Hello. In the list of changes for 22 Dec 2010 (Pre-Release Builds), you say you added a new StiOptions.Engine.ReportCache.AllowGCCollect
static property. Does this mean that you are caching reports and not
disposing them and therefore not releasing memory after each report is generated?
In the previous topic we have already described the reason of your problem and solution for it.Also does this mean that if I set this property to true it may fix the memory leak issues we are having, (as listed in the above post)?
Mpanal wrote:Ivan wrote:
Also you can try to test the new Interpretation mode of report rendering.
For select this mode, please set the CalculationMode property of the report:
Thank you.Code: Select all
report.CalculationMode = StiCalculationMode.Interpretation;
I have also problems with memory.
When I try calculation mode Interpretation, I have an error message: "Syntax error near }" I have many "}" on my report. How I can know where is the error?
If calculation mode is Compilation, I have no error. But after 100 - 120 reports, my program hangs for memory consumption.
Thank you
Code: Select all
private bool exportToStimulsoft(string reportFile, MemoryStream ms, DataSet data, ESA.Framework.Modelling.ModelObject host)
{
bool ok = false;
string dll = null;
//check for a precompiled version
try
{
dll = reportFile.ToLower().Replace(".mrt", ".dll");
bool recompile = !host.Session.fileExistsFS(dll);
if (!recompile)//check file timestamps
{
DateTime mrtDate = host.Session.fileTimestampFS(reportFile);
DateTime dllDate = host.Session.fileTimestampFS(dll);
recompile = (mrtDate.CompareTo(dllDate) > 0);
}
if (recompile)
{
using (StiReport toCompile = new StiReport())
{
toCompile.Load(reportFile);
toCompile.DataSources.Clear();
toCompile.Dictionary.Databases.Clear();
toCompile.Dictionary.ImportXMLSchema(data);
CompilerResults r = StiReport.CompileReportsToAssembly(dll, new StiReport[] { toCompile }, StiReportLanguageType.CSharp);
Logger.logInformation("Compiled Stimulsoft report into " + dll);
}
}
}
catch (Exception ex)
{
Logger.logError("Error compiling report " + reportFile, ex);
dll = null;
}
if (dll != null)
{
try
{
StiReport report = StiReport.GetReportFromAssembly(dll, false);
StiOptions.Engine.ReportCache.AllowGCCollect = true;
report.RegData(data);
Stimulsoft.Report.Export.StiPdfExportSettings settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
settings.Compressed = true;
settings.EmbeddedFonts = false;
settings.ImageQuality = host.ReportImageQuality;
publishStimulsoftRuntimeVariables(report);
report.Render(false);
report.ExportDocument(StiExportFormat.Pdf, ms, settings);
report.Dictionary.DataStore.Clear();
data.Clear();
data.Dispose();
report.Dispose();
ms.Seek(0, SeekOrigin.Begin); //rewind stream - stimulsoft used to but does not any more
ok = true;
}
catch (Exception ex)
{
Logger.logError("Error executing report from dll:" + reportFile, ex);
File.Delete(dll);
}
}
if(!ok)
{
using (StiReport report = new StiReport())
{
try
{
report.Load(reportFile);
report.DataSources.Clear();
report.Dictionary.Databases.Clear();
report.Dictionary.ImportXMLSchema(data);
report.RegData(data);
Stimulsoft.Report.Export.StiPdfExportSettings settings = new Stimulsoft.Report.Export.StiPdfExportSettings();
settings.Compressed = true;
settings.EmbeddedFonts = false;
settings.ImageQuality = host.ReportImageQuality;
publishStimulsoftRuntimeVariables(report);
report.Render(false);
report.ExportDocument(StiExportFormat.Pdf, ms, settings);
report.Dictionary.DataStore.Clear();
data.Clear();
data.Dispose();
report.Dispose();
ms.Seek(0, SeekOrigin.Begin); //rewind stream - stimulsoft used to but does not any more
ok = true;
}
catch (FormatException fex)
{
host.setMessageToken(1, fex.Message);
host.setMessageToken(2, reportFile);
host.addSystemMessage(UserMessage.Severity.Error, reportFile + ": Format Exception:" + fex.Message, "RPT_FormatException");
ok = false;
}
catch (Exception ex)
{
host.setMessageToken(1, ex.Message);
host.setMessageToken(2, reportFile);
host.addSystemMessage(UserMessage.Severity.Error, reportFile + ": There is a problem with the data sent to the report:" + ex.Message, "RPT_Exception");
ok = false;
}
}
}
return ok;
}
I have emailed the reproducible test program. We have also discvered a new bug in compiled reports - images on the mrt cause excepptions when loading from the dll - this is also included in the test application.Andrew wrote:Hello,
Please send to support@stimulsoft.com the "freshest" test project with all changes, for investigation.
We are glad to help you.
Thank you.