Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add datasources to multiple subreports when last SubreportProcessing 1

Status
Not open for further replies.

kvang

Programmer
Oct 7, 2005
129
US
I have a localreport (RDLC) has about 12 subreports. Within each subreports, there could be 2-5 more subreports. It is taking the ReportViewer too long to load the report because for every subreport, the SubreportProcessingEventHandler (SubreportProcessing event) is triggered to get data from the database for that particular subreport. All the data are coming from the same database. When the report loads, the application is hitting the database more than 20 times. That is one of the reasons why the report is taking too long to load.

What I am hoping to do is store all the information (parameters and stored procedure for each subreport dataset) to a viewstate or session, then pass an array of stored procedures to the database, get all of the data into one dataset, then load all the subreport when the last SubreportProcessingEventHandler is called. I can do this but the only problem is that the SubreportProcessingEventArgs is not serializable. I hope this make sense. Any suggestions?
 
I haven't worked with RDLCs, but I have worked with Crystal. all in all an RDLC is just displayed data, same as crstal, pdf, web page, form etc.

that said you're best bet is to load all the data before hand, then pass the data to the report. No need to serialize objects or store data in session (definitely not viewstate).

right now your report is pulling data from the database. the approach i describe is pushing data to the report. by pushing data you control how/where the data comes from. therefore you can batch your queries, or reduce the number of queries. once all the data is collected you can pass it to the report.

I would also re-think the use of so many nested reports. this sounds like a design problem, not a technical problem.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
faq732-7259
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top