Save This Page
Home » pentaho-reporting-engine-classic-0.8.10 » org » jfree » report » function » [javadoc | source]
org.jfree.report.function
public class: TotalGroupSumFunction [javadoc | source]
java.lang.Object
   org.jfree.report.function.AbstractExpression
      org.jfree.report.function.AbstractFunction
         org.jfree.report.function.TotalGroupSumFunction

All Implemented Interfaces:
    Function, Expression, Serializable

A report function that calculates the sum of one field (column) from the Data-Row. 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:

This function expects its input values to be either java.lang.Number instances or Strings that can be parsed to java.lang.Number instances using a java.text.DecimalFormat.

The function undestands two parameters, the field parameter is required and denotes the name of an ItemBand-field which gets summed up.

The parameter group denotes the name of a group. When this group is started, the counter gets reseted to null. This parameter is optional.

Constructor:
 public TotalGroupSumFunction() 
Method from org.jfree.report.function.TotalGroupSumFunction Summary:
getField,   getGroup,   getInstance,   getValue,   groupStarted,   itemsAdvanced,   reportInitialized,   setField,   setGroup
Methods from org.jfree.report.function.AbstractFunction:
groupFinished,   groupStarted,   itemsAdvanced,   itemsFinished,   itemsStarted,   reportDone,   reportFinished,   reportInitialized,   reportStarted
Methods from org.jfree.report.function.AbstractExpression:
clone,   getDataRow,   getDependencyLevel,   getInstance,   getName,   getReportConfiguration,   getResourceBundleFactory,   getRuntime,   isActive,   isDeepTraversing,   isPreserve,   setActive,   setDependencyLevel,   setName,   setPreserve,   setRuntime
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jfree.report.function.TotalGroupSumFunction Detail:
 public String getField() 
    Returns the field used by the function. The field name corresponds to a column name in the report's data-row.
 public String getGroup() 
    Returns the name of the group to be totalled.
 public Expression getInstance() 
    Return a completly separated copy of this function. The copy does no longer share any changeable objects with the original function.
 public Object getValue() 
    Return the current function value.

    The value depends (obviously) on the function implementation. For example, a page counting function will return the current page number.

 public  void groupStarted(ReportEvent event) 
    Receives notification that a group has started.
 public  void itemsAdvanced(ReportEvent event) 
    Receives notification that a row of data is being processed.
 public  void reportInitialized(ReportEvent event) 
    Receives notification that the report has started.
 public  void setField(String field) 
    Sets the field name for the function. The field name corresponds to a column name in the report's data-row.
 public  void setGroup(String group) 
    Defines the name of the group to be totalled. If the name is null, all groups are totalled.