Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1035

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Define input parameters in the same manner as query fields. You can specify a default value that ColdFusion uses when
no corresponding parameter exists. For more information on defining input parameters, see
and using fields and input
parameters" on page 1021.
You use input parameters in the following ways:
• Through the cfreportparam tag: Input parameters must correspond, by name, to
in the CFM page invocation. For example, if you define an input parameter named ReportTime, you pass a
tag with a name attribute set to ReportTime, as the following example shows:
cfreportparam
<cfreport format="PDF" template="FourthReport.cfr" query="#coursedept#">
<cfreportparam name="ReportTime" value="#DateFormat(Now())#, #TimeFormat(Now())#">
</cfreport>
• Subreport parameters: When a subreport requires information from a main report, you define subreport
parameters in the main report and corresponding input parameters in the subreport. For more information, see
"Using
subreports" on page 1033.
For information on dynamically populating input parameters at run time, see
Using CFML in reports
CFML is the scripting language for the Report Builder. By leveraging CFML, you can create reports that select and
format data to meet your needs. You use CFML in the following areas of the Report Builder:
• Advanced query mode
• Report functions
• Expressions
Advanced query mode
In some cases, you create a complex query, reuse an existing query, or encapsulate additional CFML processing as part
of query creation for the report. To use a query in these ways, you use advanced query mode to create CFML that
returns a query. When you click the Advanced button at the top of the Query Builder, the Report Builder displays a
text entry area in which you can enter CFML that generates a query. ColdFusion executes this tag at report execution
time and passes the query result set to the report.
Note: When you use advanced query mode, the Query Builder does not create query fields automatically. create the
associated query fields manually.
The CFML used in advanced query mode must include a query object whose name matches that in the Variable that
contains the query object field. You can use any CFML tag that returns a query object or the
CFML can use multiple query objects, but can only return one.
Note: If you set an empty variable (for example, <cfset name=" ">), the Report Builder throws a Report data binding
error.
This example CFML uses the
<cfhttp
url="http://quote.yahoo.com/download/quotes.csv?Symbols=csco,jnpr&format=sc1l1&ext=.csv"
method="GET"
name="qStockItems"
columns="Symbol,Change,LastTradedPrice"
textqualifier=""""
delimiter=","
firstrowasheaders="no">
tag to retrieve a query:
cfhttp
Last updated 1/20/2012
"Defining, modifying,
tags embedded
cfreportparam
"Advanced query
mode" on page 1030.
function. The
QueryNew
1030

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents