Page 1 of 1

HTTP Timeouts Happening for Large Reports

Posted: Thu Oct 24, 2013 3:48 am
by Scottioioio
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:

Code: Select all

<cc1:StiWebViewer ID="reportViewer" runat="server" Width="1000" RenderMode="AjaxWithCache" Theme="Windows7" />
And here is the code I use in the code-behind class to load and display the report:

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

Re: HTTP Timeouts Happening for Large Reports

Posted: Fri Oct 25, 2013 6:19 am
by Vladimir
Hello,

Please specify how many pages in a rendered report? The maximum number of pages for the Web is 300-500, and it depends on the complexity of the report.

Also please perform testing for the rendering of the report:

Code: Select all

...
...

// Start timer
report.Render(false);
// End timer

// View report
reportViewer.Report = report;
And let us know the time.

Thank you.

Re: HTTP Timeouts Happening for Large Reports

Posted: Fri Oct 25, 2013 4:20 pm
by Scottioioio
Vladimir, I added timing logic around both report.Render(false) and reportViewer.Report = report. I then tested with report criteria that returned about 6,500 rows from the database and resulted in 719 report pages.

The database took less than 0.5 seconds to return the data, but the report took over 8 seconds in total to completely render, a little over 4 seconds for both report.Render(false) and reportViewer.Report = report.

I understand that a report with hundreds of pages isn't realistically that useful, but our users like to generate huge reports and then export to Excel and then search from Excel for particular data points. Currently we have it configured so that if their query returns more then 7,500 records we display a message saying that they need to refine their filter criteria, but we have users that say they need to run less strict reports, ones that might return in excess of 50,000 records. But as I said before, once we start getting 30,000+ records returned we are getting ASP.NET timeouts (even though the database is returning the data in under a second).

Any tips or tricks for improving the performance of report rendering?

Thanks

Re: HTTP Timeouts Happening for Large Reports

Posted: Mon Oct 28, 2013 12:34 pm
by HighAley
Hello.

Please, read next articles on our Blog:
Optimizing Reports
Optimizing Reports. Part 2
Optimizing Reports. Part 3

Thank you.