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

All Implemented Interfaces:
    Function, Expression, Serializable

Direct Known Subclasses:
    TotalGroupSumQuotientPercentFunction

A report function that calculates the quotient of two summed fields (columns) from the report's 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 tree parameters. The dividend parameter is required and denotes the name of an ItemBand-field which gets summed up as dividend. The divisor parameter is required and denotes the name of an ItemBand-field which gets summed up as divisor.

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 TotalGroupSumQuotientFunction() 
Method from org.jfree.report.function.TotalGroupSumQuotientFunction Summary:
getDividend,   getDivisor,   getGroup,   getRoundingMode,   getScale,   getValue,   groupStarted,   itemsAdvanced,   reportInitialized,   setDependencyLevel,   setDividend,   setDivisor,   setGroup,   setRoundingMode,   setRuntime,   setScale
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.TotalGroupSumQuotientFunction Detail:
 public String getDividend() 
    Returns the field used as dividend by the function.

    The field name corresponds to a column name in the report's data-row.

 public String getDivisor() 
    Returns the field used as divisor 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 int getRoundingMode() 
    Returns the defined rounding mode. This influences the precision of the divide-operation.
 public int getScale() 
    Returns the scale for the divide-operation. The scale influences the precision of the division.
 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 setDependencyLevel(int level) 
    Defines the function's dependency level. This method forwards all calls to the interal functions.
 public  void setDividend(String dividend) 
    Sets the field name to be used as dividend for the function.

    The field name corresponds to a column name in the report's data-row.

 public  void setDivisor(String divisor) 
    Sets the field name to be used as divisor 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.
 public  void setRoundingMode(int roundingMode) 
    Defines the rounding mode. This influences the precision of the divide-operation.
 public  void setRuntime(ExpressionRuntime runtime) 
    Defines the ExpressionRune used in this expression. The ExpressionRuntime is set before the expression receives events or gets evaluated and is unset afterwards. Do not hold references on the runtime or you will create memory-leaks.
 public  void setScale(int scale) 
    Defines the scale for the divide-operation. The scale influences the precision of the division.