Monday, 21 October 2019

Displaying multiple Reports in a single report viewer Ask

Displaying multiple Reports in a single report viewer


Having reviewed the micrososft documentation, it seems you can not bind multiple reports to a viewer. As suggested here:
"Displaying a report using the CrystalReportViewer control The CrystalReportViewer control displays only one report at a time. Which report is displayed by the control is determined by which report you bind to your code. To tell the control which report to display, you bind the ReportSource property of the control to a particular report. At runtime, the control loads the report that is bound to the ReportSource property and displays it. "
The diocumentation goes on to say you can only bind a report type to the report source.
So, basically you need to build the multi view yourself. In my mind this can be done in two ways.
  • Create a report viewer for each report (maybe using a tab control)
  • Create a single viewer and display different reports based on what the user selects in your application. i.e.
I have done something simular in the past, but rather than using the report viewer, i used crystal to export the report to pdf and displayed those to the user.
I hope this is clearer. :-)

No comments:

Post a Comment