Sub Reports
The Sub Report tool allows you to:
- Design elements that are common to all reports, such as headers and footers, and edit them in one place.
- Display related data in a report without having to add extra datasets.
In the Designer, double-clicking on a sub report opens its associated report in a new Design Panel tab.
|
- Create a new Advanced Report or open an existing one.
- Fill in the Name and Description fields for the Advanced Report properties.
- Click the Data Sets option in the Property Editor form.
- Click the plus icon to add a new Data Set.
- Fill in the SQL Script Properties form as shown below, then click OK.
- Select Layout and click on the Launch Designer icon to bring up the Report Designer screen.
- If your report has no GroupHeader, add a GroupHeader by right-clicking anywhere in the Detail band. Select Insert Band, then GroupHeader. This will create a GroupHeader band above the Detail band.
- Add two Table controls to the GroupHeader and Detail bands of the report, as follows.
- Select the Table icon in the Button Bar. Then, in the GroupHeader1 band, click and hold down the left mouse button while dragging the cursor across into Detail. This will create aligned cells in each band. You could achieve the same result by individually setting up two tables, one in each band.
- Drag and drop the PROJECT, SITE_ID and END_DEPTH fields from the Field List window into the table cells as shown below:
- Double-click in tableCell1 and enter the appropriate column label, Project in this case. Repeat for the remaining table's cells with the labels Hole Number and Hole Depth. Format the labels as desired (e.g. 14 pt, bold, blue).
- Drag a Sub Report control into the pageHeader band, select the sub report control and set the properties for the sub report you wish to insert into the report header. For the Report Source URL, click the drop-down list and select Subreport Header from the list of available reports. Note that the names may differ in your drop-down list.
The result will look like the following:
- Similarly, drag a Sub Report control into the pageFooter band, select the sub report control and set the properties for the subreport you wish to insert into the report header. For the Report Source URL, click the drop-down list and select Subreport Footer from the list of available reports.
The final report layout is as follows:
- Click on the Print Preview tab to view the results. The first page is shown below. Note the header and footers from the sub reports you have created.