
1020
DEVELOPING
COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
Las
t
upda
te
d 8/5/2010
Define a group
1
Select Report > Group Management from the menu bar.
2
Click Add.
3
Specify a group name in the Name field.
4
Specify the value that controls grouping (also called a group expression) in the Group on field. At run time,
ColdFusion triggers a group break when the result of this value changes. These values are often query field names.
However, this value can also be a calculated field or other type of expression. Sample group expressions include the
following:
Query field
Creates a group break when the associated column in the result set contains a different value. The field
that you specify must be one of the sort criteria for the result set; for example, query.country.
Calculated field
Creates a group break when a calculated field returns a different value. For example, if the
expression calc.FirstLetter returns the first letter of a query column, you can group a report in alphabetical order.
Boolean expression
Creates a group break when a Boolean expression returns a different value. For example, if
your result set is sorted by the passpercentage column, you could use the Boolean expression query.passpercentage
LT 50.
5
Specify group break options:
Start New Column
Forces a new column on a group break.
Start New Page
Forces a new page on a group break.
Reset Page Number
Resets the page number to 1 on a group break.
6
Specify band size and printing information:
Min. height for group
The minimum height that must remain on a page for ColdFusion to print the group band on
that page.
Reprint Header on Each Page
Displays the group header on each page.
7
Click OK.
The Report Builder adds the group to the report and creates header and footer bands for the group.
8
Click OK again.
9
Add headings, text, query fields, calculated fields, and other information to the group’s header and footer.
Create group subtotals
1
Create a calculated field to contain the group subtotal. Create the calculated field that uses the following criteria:
•
Specify a numeric data type.
•
Select Sum in the Calculation field.
•
Specify the field to sum on in the Perform Calculation On field. For example, a report on employees by
department could sum on query.emp_salary.
•
Specify to reset the field when the group changes.
2
Place the calculated field on the report.
For more information on calculated fields, see the Report Builder online Help.
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...