Hi !
We are trying to speed up our reporting engine and I would like to see what can be done to speed things up on the report side. For now, we are using the following code :
StiReport stiReport = new StiReport();
xmlData.Position = 0;
DataSet dataset = new DataSet();
dataset.ReadXml(xmlData);
stiReport.Load(sessionInfo.SummaryReportPath);
stiReport.Dictionary.DataStore.Clear();
stiReport.Dictionary.Databases.Clear();
stiReport.RegData("Visit", dataset);
stiReport.Dictionary.Synchronize();
stiReport.PrinterSettings.ShowDialog = false;
stiReport.Compile();
stiReport.CompiledReport.Rendering += new EventHandler(OnRendering);
stiReport.Render(false);
stiReport.Print(GetPrinterSettings(sessionInfo));
xmlData.Close();
stiReport.Dispose();
I think there's an optimization possible if I use compiled reports, but I'm not sure what are the implications of using them, is there any other thing we can do to speed things up with this ?
Thanks
Sacha
For faster reports
For faster reports
Please modify your code in following way:
Thank you.
Code: Select all
StiReport stiReport = null;
xmlData.Position = 0;
DataSet dataset = new DataSet();
dataset.ReadXml(xmlData);
string compiledReportFile = "report.dll";
if (!File.Exists(compiledReportFile))
{
stiReport = new StiReport();
stiReport.Load(sessionInfo.SummaryReportPath);
stiReport.Dictionary.DataStore.Clear();
stiReport.Dictionary.Databases.Clear();
stiReport.RegData("Visit", dataset);
stiReport.Dictionary.Synchronize();
stiReport.Compile(compiledReportFile);
stiReport.CompiledReport.Rendering += new EventHandler(OnRendering);
}
else
{
stiReport = StiReport.GetReportFromAssembly(compiledReportFile, true);
stiReport.RegData("Visit", dataset);
stiReport.Rendering += new EventHandler(OnRendering);
}
stiReport.PrinterSettings.ShowDialog = false;
stiReport.Render(false);
stiReport.Print(GetPrinterSettings(sessionInfo));
xmlData.Close();
stiReport.Dispose();
For faster reports
Wow ! Huge improvement !!!
Thanks a lot !
Sacha
Thanks a lot !
Sacha
For faster reports
Let us know, if you need any help.
Thank you.
Thank you.