Subreports let you nest a report within your report. The data you display in a subreport is typically related to the data in the main report and you enable this by passing one or more subreport parameters to the subreport. However, the data displayed in a subreport can also be unrelated to the data in the main report.
Reasons to use subreports including the following:
The following figure illustrates the use of subreport parameters and the relationship between a report and a subreport:
Note: Although the Report Builder supports multiple levels of nesting, it displays one level of nesting only.
For additional information on subreports, see Report Builder online Help.
You can define a subreport and include it in a report, or you can define it as part of inserting the subreport in the main report.
However, regardless of how you define it, a subreport has the following characteristics:
If you have already defined a subreport, you add it to the main report and define subreport parameters, as necessary.
The Subreport Source panel appears.
The Report to Subreport Parameter Binding panel appears.
The Finish Subreport Setup panel appears.
The Report Builder adds the subreport to the main report, saving the report to subreport mappings as subreport parameters.
If you are certain of the data required for a subreport, you can define a new subreport while adding it to the main report.
The Subreport Source panel appears.
The Define Query Fields panel appears.
The Query Builder appears.
Specify WHERE for Condition and either ='#CFVariable#'
(string column) or =#CFVariable#
(numeric column) for Criteria, and then overtype CFVariable
with the name of the input parameter for the subreport (you define the input parameter name later in the procedure.)
The Define Report Grouping panel appears.
The Report Layout panel appears.
The Report Style panel appears.
The Report Theme panel appears.
The Report Name panel appears.
The Subreport Binding panel appears.
The Subreport Filename panel appears.
The Finish Subreport Setup panel appears.
The Report Builder adds the subreport to the main report.
The Report Builder lets you change subreport name and modify subreport parameters in a main report.
Subreport settings display in the Properties sheet.
The Subreport Parameters dialog box appears.