
1038
DEVELOPING
COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Las
t
upda
te
d 8/5/2010
Edit the heading label text
1
Double-click the LASTNAME field in the Column Header band.
2
Replace the column name with Artist Name, and click OK.
3
Replace the remaining column labels as follows:
•
ARTNAME > Title
•
DESCRIPTION > Description
•
PRICE > Price
•
ISSOLD > Sold?
Using expressions to format data
Use the Expression Builder to perform the following tasks:
•
Change the display of the ISSOLD value to a yes/no expression. By default, Report Builder displays 0 (not sold) or
1 (sold) for the ISSOLD column based on how the data is stored in the database. You can use a function to change
the display to yes or no.
•
Change the value of the PRICE column to a dollar format.
•
Concatenate the artists’ first and last names. Even though the FirstName field is a nonprinted field in the report,
you can add it to an expression because it is part of the SQL query that you created.
Change a Boolean value to yes/no
1
Double-click the query.ISSOLD element in the detail band. Report Builder displays the Expression Builder for that
element.
2
In the Expression Builder, expand the Functions folder.
3
Choose Display and Formatting from the Functions list. Report Builder displays the list of functions in the right
pane of the Expression Builder.
4
Double-click YesNoFormat from the list of functions. Report Builder automatically completes the following
expression in the expression pane:
YesNoFormat(query.ISSOLD)
5
Click OK to close the Expression Builder and return to the report.
6
Choose File > Save to save your changes to the report.
7
Press F12 to preview the report. Yes or no appears in the Sold? column based on whether the artwork sold.
Display numbers in dollar format
1
Double-click the field in the PRICE column of the detail band.
2
In the expression pane, change the expression to the following text:
DollarFormat(query.PRICE)
3
Click OK to close the Expression Builder and return to the report.
Concatenate the FIRSTNAME and LASTNAME fields
1
Double-click the query.LASTNAME field in the LASTNAME group header.
2
In the Expression Builder, type the following expression:
query.FIRSTNAME &" "& query.LASTNAME