User Guide

Table Of Contents
Creating reports with the ColdFusion MX 7 reporting 797
For more information on creating SQL statements with the Query Builder, see “Using the Query
Builder” in Report Builder online Help.
To include cfquery attributes in the SQL statement:
1.
Use the Query Builder to create a SQL statement.
2.
Click the <cfquery> Attributes button.
The CF Query Options dialog box appears.
3.
Specify cfquery attributes through dialog box fields.
4.
Click OK.
Using CFML in reports
CFML is the scripting language for the Report Builder. By leveraging CFML, you can easily
create reports that select and format data to meet your needs. You can use CFML in the following
areas of the Report Builder:
Advanced query mode
Report functions
Expressions
Advanced query mode
In some cases, you may want to use create a complex query, reuse an existing query, or encapsulate
additional CFML processing as part of query creation for the report. In this case, you can 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. You must 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 containing query object field. You can use any CFML tag that returns a query
object or the
QueryNew function. 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 tag to retrieve a query:
<cfhttp
url="http://quote.yahoo.com/download/quotes.csv?Symbols=csco,jnpr&format=sc
1l1&ext=.csv"
method="GET"
name="qStockItems"
columns="Symbol,Change,LastTradedPrice"
textqualifier=""""