Adobe COLDFUSION 9 Manual page 1039

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
The following example shows the use of subreport parameters and the relationship between a report and a subreport:
mainreport.cfr
Subreport:
subreport.cfr
Subreport expression :
custid = #query.CustomerID
subreport.cfr
param.custid
Note: Although the Report Builder supports multiple levels of nesting, it displays one level of nesting only.
For additional information on subreports, see the 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.
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 report's Subreport Expression
property.
If you have already defined a subreport, you add it to the main report and define subreport parameters, as necessary.
Add an existing subreport
1
Define or open your main report.
Click the Subreport icon in the toolbox.
2
Drag an area for the subreport in the desired report band.
3
4
Select From An Existing Report, specify the subreport, and click Next.
Select the fields in the main report that correspond to fields in the subreport and click Next.
5
Click Finish.
6
The Report Builder adds the subreport to the main report, saving the report to subreport mappings as subreport
parameters.
To modify subreport parameter settings, select the subreport and click Subreport Parameters in the Properties
7
panel.
SELECT CustomerID, CompanyName,
ContactName
FROM Customers
WHERE (CustomerID = '#param.custid#')
Last updated 8/5/2010
1034

Advertisement

Table of Contents
loading

Table of Contents