Class TotalPageSumFunction
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.function.AbstractExpression
-
- org.pentaho.reporting.engine.classic.core.function.AbstractFunction
-
- org.pentaho.reporting.engine.classic.core.function.TotalGroupSumFunction
-
- org.pentaho.reporting.engine.classic.core.function.TotalPageSumFunction
-
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,PageEventListener
,ReportListener
,AggregationFunction
,Expression
,FieldAggregationFunction
,Function
public class TotalPageSumFunction extends TotalGroupSumFunction implements PageEventListener
Calculates the sum of a field for an entire page. The function will also reset by group if the optionalgroup
parameter is specified. If the specified group spans a page break, the sum will be reset with the new page and sum only the items for the group from the subsequent page.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.pentaho.reporting.engine.classic.core.function.TotalGroupSumFunction
currentGroupKey, ZERO
-
-
Constructor Summary
Constructors Constructor Description TotalPageSumFunction()
Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Expression
getInstance()
Return a completly separated copy of this function.Object
getValue()
Return the current function value.void
groupFinished(ReportEvent event)
If this is the group associated with the function, store away the final valueprotected boolean
isPrepareRunLevel(ReportEvent event)
void
pageFinished(ReportEvent event)
Handles the pageFinishedEvent.void
pageStarted(ReportEvent event)
Handles the pageStartedEvent.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.TotalGroupSumFunction
clear, clone, getCrosstabFilterGroup, getField, getGroup, groupStarted, itemsAdvanced, reportInitialized, setCrosstabFilterGroup, setField, setGroup, summaryRowSelection
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setDependencyLevel, setName, setPreserve, setRuntime
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.function.Expression
getDataRow, getDependencyLevel, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setDependencyLevel, setName, setRuntime
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.event.ReportListener
itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted
-
-
-
-
Method Detail
-
isPrepareRunLevel
protected boolean isPrepareRunLevel(ReportEvent event)
- Overrides:
isPrepareRunLevel
in classTotalGroupSumFunction
-
groupFinished
public void groupFinished(ReportEvent event)
If this is the group associated with the function, store away the final value- Specified by:
groupFinished
in interfaceReportListener
- Overrides:
groupFinished
in classAbstractFunction
- Parameters:
event
- the event.
-
pageStarted
public void pageStarted(ReportEvent event)
Handles the pageStartedEvent.- Specified by:
pageStarted
in interfacePageEventListener
- Parameters:
event
- the report event.
-
pageFinished
public void pageFinished(ReportEvent event)
Handles the pageFinishedEvent. Stores the current page value and clears the counter. pageFinished can be hit multiple times for a single page, but the stored value should be consistent.- Specified by:
pageFinished
in interfacePageEventListener
- Parameters:
event
- the report event.
-
getValue
public Object getValue()
Description copied from class:TotalGroupSumFunction
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.
- Specified by:
getValue
in interfaceExpression
- Overrides:
getValue
in classTotalGroupSumFunction
- Returns:
- The value of the function.
-
getInstance
public Expression getInstance()
Return a completly separated copy of this function. The copy no longer shares any changeable objects with the original function.- Specified by:
getInstance
in interfaceExpression
- Overrides:
getInstance
in classTotalGroupSumFunction
- Returns:
- a copy of this function.
-
-