Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1037

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
<cfargument name="Name" required="yes"/>
<cfargument name="Address1" required="yes"/>
<cfargument name="Address2" required="yes"/>
<cfargument name="City" required="yes"/>
<cfargument name="State" required="yes"/>
<cfargument name="Zip" required="yes"/>
<cfset variables.CRLF = Chr(13) & Chr(10)>
<cfset variables.ResultVar="">
<cfif Trim(arguments.Name) NEQ "">
<cfset variables.ResultVar='#arguments.Name#'>
</cfif>
<cfif Trim(arguments.Address1) NEQ "">
<cfif variables.ResultVar NEQ "">
<cfset variables.ResultVar='#variables.ResultVar & variables.CRLF#'>
</cfif>
<cfset variables.ResultVar='#variables.ResultVar & arguments.Address1#'>
</cfif>
<cfif Trim(arguments.Address2) NEQ "">
<cfif variables.ResultVar NEQ "">
<cfset variables.ResultVar='#variables.ResultVar & variables.CRLF#'>
</cfif>
<cfset variables.ResultVar='#variables.ResultVar & arguments.Address2#'>
</cfif>
<cfif variables.ResultVar NEQ "">
<cfset variables.ResultVar='#variables.ResultVar & variables.CRLF#'>
</cfif>
<cfset variables.ResultVar='#variables.ResultVar & arguments.City & ", " & arguments.State
& " " & arguments.Zip#'>
<cfreturn variables.ResultVar>
Use a report function
1
Place a dynamic field on the appropriate report band.
The Add Field dialog box displays.
Specify Manually Entered Expression, and click OK.
2
The Expression Builder displays.
Specify "report.functionname", and click OK.
3
Using expressions
Many elements of the Report Builder (including query fields, calculated fields, input parameters, images, and report
object attributes) are single operand ColdFusion expressions. Because these elements are expressions, you can
manipulate them with CFML functions.
The Expression Builder is a graphical interface that lets you quickly apply CFML functions to Report Builder elements.
Uses for the Expression Builder include the following:
• Many of the report object attributes (such as PrintWhen) accept expressions, which you can associate with query
parameters, input parameters, or ColdFusion page variables. You can tie report attributes and columns to display
based on run-time data or user preference.
Last updated 1/20/2012
1032

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents