I have a main report that queries for payments made based on a time frame. It uses a DataSet (tableadapter with parameters for time frame). The reportviewer is hosted on a web page as a local report. When I browse to the page that invokes the
reportviewer, it's absolutely blank for about 90 seconds, then I get the reportviewer "Loading..." for a brief second or 2, then the report displays. It's 11 pages. Looks great, I would really hate to abandon the design with the subreport.
But processing for this long will not be acceptable when the customer needs to run the report for an entire month. Or even 2 weeks.
It's a 2 table query (view) that has main data for the data row, then children for what accounts were paid for on one payment processing transaction. The query isn't the problem. I've turned on SQL profile, to make sure it's running the query
only once. The query for only 4 days of transactions is returning 133 rows and the report takes 1.5 minutes.
I set up the typical event for subreportprocessing. The GetPaymentDetails method is using a static list in memory that only gets populated once.
void LocalReport_SubreportProcessing(object sender, Microsoft.Reporting.WebForms.SubreportProcessingEventArgs e)
{
// get LogPaymentID from the parameters
int iLogPaymentID = Convert.ToInt32(e.Parameters[0].Values[0]);
e.DataSources.Clear();
CustomDS dataObj = new CustomDS();
var subReportRows = CustomDS.GetPaymentDetails().FindAll(element => element.LogPaymentID == iLogPaymentID);
e.DataSources.Add(new Microsoft.Reporting.WebForms.ReportDataSource()
{
Name = "DSPaymentDetailsChild",
Value = subReportRows
});
}
Is there any hope of speeding this up? Where can I set some break points to see what event is consuming all the time? Can I put a break point before and right after all the calls to the subprocessing event? (in this case after the 133 calls to
this function. I want to put a timer on how long that took.) If I have to abandon ship on use of the subreport, any suggestions on it's replacement? (I'm using VS2012 and version 11.0 of the report viewer.)
Thanks, Donna