I've followed along with the video at http://tv.telerik.com/reporting/video/telerik_trainer_-_reporting_subreports. This is basically the way I have created all of my Master-Detail reports. I use a ReportParameter/Filter combo on the subreport and a corresponding parameter on the master report.
However, on one report in particular it is very, very slow. Sixty seconds. That's painfully slow to me. The master report lists on the most basic fields from a Driver's record:
SELECT id, firstName, middleName, lastName, phone1, phone2, phone3, city, experience, endorsements, class, quality, hired, applied |
From vw_dmsDriver |
WHERE (Assigned=0) AND (AvailabilityID = 1) AND MarketId=1 |
The subreport contains all the individual notes for that driver from a related table:
SELECT [Value] |
,Username |
,DriverID |
,[TimeStamp] |
FROM vw_dmsDriverNotesPrivate |
I don't know the ins-and-outs of what's going on behind the scenes, but I really don't think it should take that long.
So I was then reading this: http://www.telerik.com/help/reporting/designing-reports-master-detail.html, and it pointed me to this video http://tv.telerik.com/reporting/video/Telerik_Reporting_-_Design_Time_Support_for_Parameterized_Queries. I thought this might enable me to get a little better performance out of the report by passing parameters to the DataAdapter's SelectCommand, rather than using the ReportParameter/Filter.
Unfortunately, the example code at the bottom of the http://www.telerik.com/help/reporting/designing-reports-master-detail.html doesn't seem to work.
Running a report for either of these queries separately, is near instantaneous. It almost seems to me that the subreport is loading every record and ignoring the parameter, and then applying the filter after ALL records have been returned, but what do I know?
Any advice would be appreciated. If there is any other detail I can provide, please let me know.