Description
A report function that calculates the sum of one field (column) from the data source.
This function produces a global total. The total sum of the group is known when the group processing starts and the report is not performing a prepare-run. The sum is calculated in the prepare run and recalled in the printing run.
The function can be used in two ways:
- to calculate a sum for the entire report
- to calculate a sum within a particular group
This function expects its input values to be java.lang.Number instances.
The function understands two parameters:
- _field parameter is required and denotes the name of an ItemBand-field which gets summed up.
- _group parameter denotes the name of a group. When this group is started, the counter gets reset to null.
Example
<function class="org.jfree.report.function.TotalGroupSumFunction" deplevel="" name="Orders Count"> <properties> <property name="group">ORDER NUMBER GROUP</property> <property name="field">CUSTOMER</property> </properties> </function>