HTTP Timeouts Happening for Large Reports
Posted: Thu Oct 24, 2013 3:48 am
I am displaying a rather simple report in an ASP.NET WebForms page using the StiWebViewer control. The report contains a single table that has six columns.
The report works wonderfully when the database returns less than a couple thousand rows, but when the database returns several thousand or tens of thousands of rows the report performance degrades so much that users are experiencing HTTP execution timeouts. (ASP.NET is bombing out after not having completed the request after 90 seconds.)
I know the problem isn't a slow running database query - using SQL Profiler I see the query is executed and the results are returned in less than one second. My presumption, then, is that it's the report viewer that's taking so long to render the report.
Here is the markup I use in the ASP.NET page to display the report:
And here is the code I use in the code-behind class to load and display the report:
I can send you the actual .mrt report file if that would help, although I'd rather do so through email rather than a public forum. Unfortunately, I can't get you the database for security reasons.
Any ideas or suggestions on how to speed up this report when displaying tens of thousands of records?
Thanks
The report works wonderfully when the database returns less than a couple thousand rows, but when the database returns several thousand or tens of thousands of rows the report performance degrades so much that users are experiencing HTTP execution timeouts. (ASP.NET is bombing out after not having completed the request after 90 seconds.)
I know the problem isn't a slow running database query - using SQL Profiler I see the query is executed and the results are returned in less than one second. My presumption, then, is that it's the report viewer that's taking so long to render the report.
Here is the markup I use in the ASP.NET page to display the report:
Code: Select all
<cc1:StiWebViewer ID="reportViewer" runat="server" Width="1000" RenderMode="AjaxWithCache" Theme="Windows7" />
Code: Select all
// Load report
StiReport report = new StiReport();
report.Load(Server.MapPath("~/App_Data/Reports/MyReport.mrt"));
string connectionString = "...";
report.Dictionary.Databases.Clear();
report.Dictionary.Databases.Add(new StiSqlDatabase("DbConnection", connectionString));
// Set variables
report.Dictionary.Variables["OccurredWhereClause"].Value = string.Format("AND aud.Occurred >= '{0}' AND aud.Occurred < '{1}'", this.StartDate.ToUniversalTime(), this.EndDate.AddDays(1.0).ToUniversalTime());
// There are a number of filtering criteria like the one above, which I've removed for brevity...
// View report
reportViewer.Report = report;
I can send you the actual .mrt report file if that would help, although I'd rather do so through email rather than a public forum. Unfortunately, I can't get you the database for security reasons.
Any ideas or suggestions on how to speed up this report when displaying tens of thousands of records?
Thanks