The Report Builder supports variable data through query fields, input parameters, and calculated fields, as follows:
Query field Maps to columns in the database result set associated with the report. You define one query field for each column in the associated database query.
Calculated field Analyzes or sums multiple detail rows in a report. ColdFusion dynamically generates calculated field values at report-generation time, optionally recalculating the value with each new report, page, column, or group.
Input parameter Specifies data fields that you pass to the report at runtime through the cfreportparam
tag or from a main report to a subreport. You can place input parameters directly on a report band or you can use them as input to a calculated field.
The Add Query Field dialog box appears.
Object |
Time |
Long |
Boolean |
Double |
Short |
Byte |
Float |
Big Decimal |
Date |
Integer |
Image |
Time Stamp |
BLOB |
String |
Note: The Query Builder defines query fields automatically for all database columns in the result set (does not apply to the Advanced Query Builder). Additionally, if you run the Query Builder as part of the Report Creation Wizard, the wizard places query fields on the report.
The Add Calculated Field dialog box appears.
Calculation Specifies the type of calculation that ColdFusion performs. Valid values are: Average, Count, Highest, Lowest, Nothing, Standard Deviation, Sum, System, and Variance. If you specify Nothing, you typically use the Perform Calculation On field to specify a dynamic expression. With the exception of Nothing (for which you use the Perform Calculation On field) and System (for which you write a customized scriptlet class), you use these calculations for group, page, and report totals.
Perform Calculation On Specifies a field or expression. Click the ... button to display the Expression Builder.
Initial Value Specifies an initial value for the calculated field.
Reset Field When Specifies when to reset the calculated field value. Valid values are: None, Report, Page, Column Group.
Reset Group If Reset Field When is set to Group, use this field to specify the group whose group break triggers the reset.
For additional information on calculated fields, see "Add Calculated Field dialog box" in Report Builder online Help and Expressions and the Expression Builder.
Enter a value for the name field. This must match an input parameter, such as the name attribute of a cfreportparam
tag included in the cfreport
tag that invokes the report definition.
For more information on using input parameters, see Using input parameters to pass variables and other data at runtime and Using subreports.
For example, you might have a query field named query.emp_salary and a calculated field that sums query.emp_salary, resetting it with each group. Place query.emp_salary in the detail band, and the associated calculated field in the group footer band.