The articles in this section of the Knowledge Base involve working with and creating Master Detail Lists for display in reports. To access the Report Designer, select Toolbox Setup > Design Reports > Design (Report Type) Report. Select New Report to design a report from scratch or New Report from Existing. Select Designer to open Report Designer.
It is sometimes necessary to create reports and render data that is organized in some levels and connected. For example, Products and Subassemblies are connected in that Subasssemblies make up Products. In this case, Master-Detail reports are used. Master-Detail reports are reports in which the value of the Master data source corresponds to the number of values (from 0 and greater) from the Detail data source. Figure 01 features an example of a Master-Detail report.
As demonstrated in Figure 01, each Product corresponds to the list of Subassemblies for that Product. Figure 02 features an example of the report template that generates this report.
The data displayed in the detail section of a Master-Detail report is nested data. The data is nested into one data row of the Master data source. The amount of nesting is called the level of nesting. If two lists are output in the Master-Detail report, and the second list is connected to the first, then this example has two levels of nesting, the first being the Master and the second the Detail.
To create a Master-Detail report, place two data bands on a page in the report template. Assign the Master data source (Products) to the first band, and assign the Detail data source (Subassemblies) to the second data band.
The data bands need to be connected, or two full lists will be printed, one after the other. The data bands are bound using the Master Component property of the second band. The Master band should be assigned as the Master Component for the second band.
The Master Component can be assigned through the property or directly through the Data Band Editor window.
After the Master Component has been assigned, the two bands are bound to each other. When one row of the Master band is printed, all of the rows of the Detail band are output, repeatedly. To fix this, so that detailed data is selected only for the specific Master band row, a Relation is used.
A Relation is created using the Data Relation property of the Detail band, or the Relation tab of the Detail Band’s Data Editor Window.
Learn More about Creating a Relation
Once the Master Component property and the Relation have been established, the report is ready to be rendered and should resemble Figure 01.