Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1044

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
Notice that the Expression Builder prompts you with the available field names as you type.
3
Click the OK button in the Expression Builder.
4
Choose File > Save from the Report Builder menu bar to save your changes to the report.
Press F12 to preview the report.
5
Report Builder displays the first and last name for each of the artists. Notice that the report still is grouped
alphabetically by last name.
Close the preview window.
6
Adding page breaks before group changes
Create a page break so that each artist name starts on at the top of a page in the report output.
Add page breaks between artist names
1
Choose Report > Group Management from the main menu bar. The Group Management dialog box appears with
LASTNAME selected.
2
Click the Edit button.
Select the Start New Page option and click OK.
3
Adding a calculated field
Calculate the sum of the artwork sold by artist
Choose Window > Fields and Parameters.
1
Report Builder displays the Fields and Parameters panel.
2
3
Expand the list of calculated fields.
With Calculated Fields selected, click the (+) button at the upper edge of the Fields and Parameters panel.
4
Make the following changes in the Add Calculated Field dialog box:
5
Change the name of the calculated field to Sold.
a
Change the label text to Sold.
b
Change the Data Type to Float.
c
d
Change the Calculation to Sum.
In the Perform Calculation On field, enter the following expression:
e
Iif(IsBoolean(query.ISSOLD) and query.ISSOLD, query.Price,0)
This expression multiplies the total price of the artwork per artist by the number of items sold to calculate the
total sales per artist. If the ISSOLD value for a record is 1 (sold), the value is multiplied by 1 and added to the
total; if the ISSOLD value for a record is 0 (unsold), the value is multiplied by 0.
Change the Reset Field When value to Group.
f
g
Change the Reset Group value to LASTNAME, and click OK. Report Builder adds the calculated field definition
in the Fields and Parameters panel.
Add the calculated field to your report
Insert a field in the LASTNAME Footer band.
1
In the Add Field dialog box, select calc.Sold from the pop-up menu.
2
Last updated 1/20/2012
1039

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents