Adobe COLDFUSION 9 Manual page 1036

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Another possible use of advanced query mode is to test for passed parameters in the URL or FORM scopes and use
those parameters to retrieve data, as the following example shows:
<!--- First look for URL param. URL overrides cfreportparam. --->
<cfif isDefined("url.deptidin")>
<cfset param.deptidin = url.deptidin>
</cfif>
<!-- Then look for FORM param. Overrides URL param. --->
<cfif isDefined("form.deptidin")>
<cfset param.deptidin = form.deptidin>
</cfif>
<cfquery name="CFReportDataQuery" datasource="cfdocexamples">
SELECTLastName, FirstName, Dept_ID
FROMEmployee
WHERE (Dept_ID = #param.deptidin#)
</cfquery>
Using report functions
Report functions are user-defined CFML functions that you code using the Report Function Editor and run in report
fields. You can use them to format data (such as concatenating and formatting all the field that make up an address),
to retrieve data, and for many other purposes.
Three built-in functions are unique to Report Builder:
For more information, see the Report Builder online Help.
Report Builder built-in functions
1
Select Report > Report Functions from the menu bar.
The Report Function Editor displays.
2
Click the Add Default Functions icon (the first on the left).
The built-in functions are added to the left pane.
3
Select a function from the left pane.
Commented code associated with the function appears in the right pane.
Modify the code and click OK.
4
Create a report function
Select Report > Report Functions from the menu bar.
1
The Report Function Editor displays.
2
Click the plus sign to add a new report function.
The Add Report Function dialog box displays.
3
Specify a name and click OK.
The Report Function Editor places a
4
Code the function, and click OK. The function is a ColdFusion user-defined function so all UDF rules and features
5
are available for use. The following example shows a report function that concatenates address fields:
InitializeReport
tag in the text entry area.
cfreturn
Last updated 8/5/2010
,
, and
BeforeExport
FinalizeReport
1031
.

Advertisement

Table of Contents
loading

Table of Contents