Below is my C# code to display a report using Active Reports.
DataDynamics.ActiveReports.Viewer.Viewer VBatchInvoice;
List<M3.UDT.ReportData> lstReport="Values comes from database near about 800 records"
ar.DataSource = lstReport;
ar.Run();
VBatchInvoice.Document = ar.Document;
This main report also include a subreport.
The statement ar.Run() is taking about 10 seconds. My client says it is too much time. I want to reduce this time as much is possible. What possible reasons are there that this is taking so long to generate? Any solution for this problem would be appreciated.
I suggest giving the accepted answer from this a read:
What are the generic ways to make Reporting Services faster
I would also pinpoint your attention to point 3.
Active reports are generally slow, but there are things you can do to try and reduce this.
Optimising parts of your code and so on. However I doubt this will effect the ar.run part of your code.
Unless you do a bit of logic in the report itself. Your logic should be done at the data source. So that Active Reports has less to do when building the report. It may also be worth checking if you need 800records into one report.
Over more, could this be implemented as an overnight process? I know 10minutes really isn't a long time, however if it can be done. Why not create these reports over night using a scheduler? Of course this should only be done if the report is used often, and only relies on yesterdays data.
Optimising
Again this can be done in several areas:
SQL - ensure this side is running smoothly and efficiently, sql does offer execute times on stored procedures, which is useful. However SQL is usually efficient unless you have made things over complicated.
.Net - Do your logic here! Look into using a DataReader instead of List or DataTable, DataReader is usually faster. The main point here is the logic!
ActiveReports - No logic please! Unless absolutely has to be done at this point.