I have a .mrt containing a header that gets populated using by passing some variables at run time.
Also at runtime I am adding to this report about 50 tables each containing about 128 unpopulated cells and after databind 300 populated cells (30 lines by 10 columns) and the corresponding 50 DataTabels to provide data for each of those tables.
The sequence of code is pretty much the following:
Code: Select all
StiReport report = new StiReport();
report.CalculationMode = StiCalculationMode.Compilation;
string strReportPath = Server.MapPath(System.Configuration.ConfigurationManager.AppSettings["ReportTemplate"]);
report.Load(strReportPath);
for (int nn = 0; nn < 50; nn++)
{
DataTable tblDR = DBUtils.GetData( nn );
tblDR.TableName = String.Format("{0}_{1}", "tblDR", nn);
report.RegData(tblDR.TableName, tblDR);
report.Dictionary.Synchronize();
StiPage page = report.Pages[report.Pages.Count - 1];
StiTable table = new StiTable();
table.Name = String.Format("{0}_{1}", "TableData", nn);
table.DataSourceName = String.Format("{0}", tblDR.TableName);
table.RowCount = 8;
table.HeaderRowsCount = 1;
table.FooterRowsCount = 6;
page.Components.Add(table);
table.CreateCell();
for (int ci = 0; ci < tblDR.Columns.Count; ci++)
{
// set up databinding for data cells and some forumlas for footer cells
}
}
report.ReportCacheMode = StiReportCacheMode.On;
StiOptions.Engine.ReportCache.LimitForStartUsingCache = 30;
StiOptions.Engine.ReportCache.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
report.Compile();
report.Render();
StiWebViewer1.Report = report;
StiWebViewer1.DataBind();
I am using a PC with 6GB RAM, i7 QuadCore processor.
Can anyone give me some tips on what to change to prevent this?
Looking forward for any advice.