User Guide

Table Of Contents
Creating reports with the ColdFusion MX 7 reporting 801
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.
Defining a subreport
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:
Data displayed in the detail band only. A subreport uses no header or footer bands.
If the subreport is related to the main report, it must include an internal query that uses a
SELECT statement with a WHERE clause specifying the name of the input parameter used in
the main reports Subreport Expression property.
Adding an existing subreport to a report
If you have already defined a subreport, you add it to the main report and define subreport
parameters, as necessary.
To add an existing subreport to a report:
1.
Define or open your main report.
2.
Click the Subreport icon in the toolbox.
3.
Drag an area for the subreport in the desired report band.
The Subreport Source panel appears.
4.
Select From an Existing Report, specify the subreport, and click Next.
The Report to Subreport Parameter Binding panel appears.
5.
Select the fields in the main report that correspond to fields in the subreport and click Next.
The Finish Subreport Setup panel appears.
mainreport.cfr
Subreport:
subreport.cfr
Subreport expression
custid = #query.CustomerID
subreport.cfr
param.custid
Select CustomerID, CompanyName,
ContactName
FROM Customers
WHERE (CustomerID = '#param.custid#')