
1034
DEVELOPING
COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Las
t
upda
te
d 8/5/2010
The following example shows 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 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.
2
Click the Subreport icon in the toolbox.
3
Drag an area for the subreport in the desired report band.
4
Select From An Existing Report, specify the subreport, and click Next.
5
Select the fields in the main report that correspond to fields in the subreport and click Next.
6
Click Finish.
The Report Builder adds the subreport to the main report, saving the report to subreport mappings as subreport
parameters.
7
To modify subreport parameter settings, select the subreport and click Subreport Parameters in the Properties
panel.
param.custid
mainreport.cfr
subreport.cfr
Subreport:
subreport.cfr
Subreport expression :
custid = #query.CustomerID
SELECT CustomerID, CompanyName,
ContactName
FROM Customers
WHERE (CustomerID = '#param.custid#')
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...