When you want to separate the details from the master report, you can create two separate reports and embed the detail report in the master report using Subreport control. A parameter is passed from the master report to detail report to filter the details.
This tutorial guides you through the steps to create a Master-detail report using subreport in Wyn Enterprise Report Designer.
Note: This tutorial uses sample SalesByRegion data set.
After you complete this tutorial, you will have a report that looks similar to the following.
(Parameter1 = Canada West)
To create a master report, we will use List data region. The List data region will contain TextBox controls to display the data, and a Subreport control to display detail report. The List data region repeats any report control it contains for every record in the dataset.
Drag and drop the Subreport control onto the list. Arrange the controls such that the report now looks like the following.
Verify that the hierarchy of the controls added in the report is as follows. This can be viewed in Explorer by clicking .
Let us add the parameter that will be passed to the detail report to display the details accordingly.
Note: The name of the parameter in master report and detail report (subreport) should be same.
Store ID - {StoreID}
Details for region: {@Parameter1}
Note: The Data Set Name property of the List data region is already set to SalesByRegion data set.
Let us embed the parameterized report created in Create Parameterized Report as a detail report and pass the parameter as filter to the detail report data from the master report.
To embed the detail report to master report,
From the Properties pane, set the Report Name property to the detail report's name, that is, 'Details Report'.
Note: As you select the Report Name property of Subreport control, you see two Report parameters. It is because the report passed in the Subreport control has two parameters. We will set these parameters later.
We will add two parameters in the master report since the subreport contains two parameters. Parameter1 will be used to filter the region based on the selection from the user prompt. Parameter2 will be used to filter the data based on store id values.
{@Parameter1}
{StoreID}
To group the details for each store id,
Note: You may need to resize and reposition the controls on the report to accommodate data, and for a cleaner look.
To customize the text boxes with information on store id and details for region,