Report functions are user-defined CFML functions that you code using the Report Function Editor and invoke 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.
The Report Function Editor displays.
The Add Report Function dialog box displays.
cfreturn
tag in the text entry area.
<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>
The Add Field dialog box displays.
The Expression Builder displays.
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:
For information on using the Expression Builder, see Report Builder online Help.
For more information on expressions, see Using Expressions and Number Signs.