ItemAvgFunction

A report function that calculates the average of one field (column) from the data source. This function produces a running average, no global average. The function can be used in two ways:

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.
<function class="org.jfree.report.function.ItemAvgFunction" name="Actual_Avg">
  <properties>
     <property name="field">ACTUAL</property>
     <property name="group">RegionGroup</property>
  </properties>
</function>