tags:

views:

3188

answers:

3

Does anyone have a recommendation for an excellent reference on Microsoft's ReportViewer (VS 2008 flavour) when used in local mode? I'm currently using it but parts of it are a bit of a black box so I'd like to read up on the entire subject.

Especially want to start using sub-reports to display more complex parent-child reports. I'm assuming they work in a similar mode to Crystal Reports with which I'm reasonably familar.

Thanks, Rob.

+1  A: 

I worked with the ReportViewer control at one point and was able to find some good information at http://www.gotreportviewer.com

Adam
Thanks for the reference - it looks useful
Rob Nicholson
A: 

Was the documentation insufficient? In what way?

John Saunders
Yes in that for example in the samples and walkthroughs, I can't see anything on subreports in local mode. I was looking for that document that's often missing from pure reference libraries - the overview and discussion of the design principles. For example, why do you have to drop a table or list on there. Why if you don't does it add =First() around the field. I know the answers now but it was a lot of digging to find the answers.
Rob Nicholson
@Rob: Thanks. If you've found some of the answers, then maybe you should write up some articles, or contribute by answering questions here on SO, or on http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/threads. For instance, I haven't used the ReportViewer controls; how does local mode differ? Why are subreports different when using the control? If you've learned the hard way, maybe you can help others avoid that. Thanks again.
John Saunders
+2  A: 

The link to http://www.gotreportviewer.com is a good once but it does look like material on local sub reports and ReportViewer 2008 is a little sparse and spreadout across the net. It would be a subject worth blogging about so I will :-)

Here are a few headlines:

  1. A subreport is a completely separate report but is linked to the master report using the standard report parameter mechanism. The master report is configured to pass one or more of it's fields (e.g. the primary key) to the subreport. The subreport typically then uses this parameter as a parameter to it's own query to load a dataset
  2. Even though you may have defined a data source against the subreport when designing it, this isn't used when used in a master report. Instead you have to implement a handler for the SubreportProcessing event. The same handler is called for each subreport you add to your master report so you can query the parameters passed to the handler to determine the dataset to load.
  3. The event handler is called once for each record in master report. For example, if the master report displays 200 records, the event handler is called 200 times but with a different parameter each time.
  4. Because of this, you have to be wary of performance. The first report I ran had 2,000 records (perfectly okay for a flat report) but each of those 2,000 records fetched 20 child records for the subreport. It did run but took several minutes before the report was rendered
  5. If you can structure your data so that a single dataset can be used containing data for both the master and subreport, then nested data regions have better performance - only one query to return 2,000 records not 2,000 individual queries. See http://www.gotreportviewer.com/masterdetail/index.html

Cheers, Rob.

Rob Nicholson

related questions