|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.engine.classic.core.function.AbstractExpression
org.pentaho.reporting.engine.classic.core.function.AbstractFunction
org.pentaho.reporting.engine.classic.core.function.TotalGroupSumFunction
public class TotalGroupSumFunction
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: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 Summary | |
---|---|
TotalGroupSumFunction()
Constructs a new function. |
Method Summary | |
---|---|
String |
getField()
Returns the field used by the function. |
String |
getGroup()
Returns the name of the group to be totalled. |
Expression |
getInstance()
Return a completly separated copy of this function. |
Object |
getValue()
Return the current function value. |
void |
groupStarted(ReportEvent event)
Receives notification that a group has started. |
void |
itemsAdvanced(ReportEvent event)
Receives notification that a row of data is being processed. |
void |
reportInitialized(ReportEvent event)
Receives notification that the report has started. |
void |
setField(String field)
Sets the field name for the function. |
void |
setGroup(String group)
Defines the name of the group to be totalled. |
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction |
---|
groupFinished, itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted |
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression |
---|
clone, getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.pentaho.reporting.engine.classic.core.event.ReportListener |
---|
groupFinished, itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted |
Methods inherited from interface org.pentaho.reporting.engine.classic.core.function.Expression |
---|
clone, getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setDependencyLevel, setName, setRuntime |
Constructor Detail |
---|
public TotalGroupSumFunction()
Initially the function has no name...be sure to assign one before using the function.
Method Detail |
---|
public void reportInitialized(ReportEvent event)
reportInitialized
in interface ReportListener
reportInitialized
in class AbstractFunction
event
- the event.public void groupStarted(ReportEvent event)
groupStarted
in interface ReportListener
groupStarted
in class AbstractFunction
event
- the event.public void itemsAdvanced(ReportEvent event)
itemsAdvanced
in interface ReportListener
itemsAdvanced
in class AbstractFunction
event
- the event.public String getGroup()
getGroup
in interface AggregationFunction
public void setGroup(String group)
setGroup
in interface AggregationFunction
group
- the group name.public Object getValue()
The value depends (obviously) on the function implementation. For example, a page counting function will return the current page number.
getValue
in interface Expression
public String getField()
getField
in interface FieldAggregationFunction
public void setField(String field)
setField
in interface FieldAggregationFunction
field
- the field name.public Expression getInstance()
getInstance
in interface Expression
getInstance
in class AbstractExpression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |