org.pentaho.reporting.engine.classic.core.function
Class PageTotalFunction

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.function.AbstractExpression
      extended by org.pentaho.reporting.engine.classic.core.function.AbstractFunction
          extended by org.pentaho.reporting.engine.classic.core.function.PageFunction
              extended by org.pentaho.reporting.engine.classic.core.function.PageTotalFunction
All Implemented Interfaces:
Serializable, Cloneable, EventListener, PageEventListener, ReportListener, Expression, Function

public class PageTotalFunction
extends PageFunction

Prints the total number of pages of an report. If a group is specified, this function expects the group to have the manual pagebreak enabled.

This function will only work as expected in group mode if the named group has pagebreak-before set to true on the header for pagebreak-after set to true on the group's footer.

Author:
Thomas Morgner
See Also:
Serialized Form

Constructor Summary
PageTotalFunction()
          Creates a new page total function.
 
Method Summary
 Expression getInstance()
          Return a completly separated copy of this function.
 Object getValue()
          Returns the page number (function value).
 void groupFinished(ReportEvent event)
          Receives notification that a group has finished.
 void groupStarted(ReportEvent event)
          Receives notification that a group has started.
 void pageFinished(ReportEvent event)
          Receives notification that a page is completed.
 void reportDone(ReportEvent event)
          Receives notification that report generation has completed, the report footer was printed, no more output is done.
 void reportInitialized(ReportEvent event)
          Receives notification that the report has started.
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.PageFunction
getDependencyLevel, getGroup, getPage, getPageIncrement, getStartPage, isDeepTraversing, pageStarted, setDependencyLevel, setGroup, setIgnorePageCancelEvents, setPageIncrement, setStartPage
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
itemsAdvanced, itemsFinished, itemsStarted, reportFinished, reportStarted
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
clone, getDataRow, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isPreserve, setActive, 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.function.Expression
clone, getDataRow, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isPreserve, setName, setRuntime
 

Constructor Detail

PageTotalFunction

public PageTotalFunction()
Creates a new page total function.

Method Detail

reportInitialized

public void reportInitialized(ReportEvent event)
Receives notification that the report has started.

Specified by:
reportInitialized in interface ReportListener
Overrides:
reportInitialized in class PageFunction
Parameters:
event - the event.

groupStarted

public void groupStarted(ReportEvent event)
Description copied from class: PageFunction
Receives notification that a group has started.

Specified by:
groupStarted in interface ReportListener
Overrides:
groupStarted in class PageFunction
Parameters:
event - the event.

groupFinished

public void groupFinished(ReportEvent event)
Description copied from class: AbstractFunction
Receives notification that a group has finished.

Specified by:
groupFinished in interface ReportListener
Overrides:
groupFinished in class AbstractFunction
Parameters:
event - the event.

pageFinished

public void pageFinished(ReportEvent event)
Description copied from class: PageFunction
Receives notification that a page is completed.

Specified by:
pageFinished in interface PageEventListener
Overrides:
pageFinished in class PageFunction
Parameters:
event - The event.

reportDone

public void reportDone(ReportEvent event)
Description copied from class: AbstractFunction
Receives notification that report generation has completed, the report footer was printed, no more output is done. This is a helper event to shut down the output service.

Specified by:
reportDone in interface ReportListener
Overrides:
reportDone in class AbstractFunction
Parameters:
event - The event.

getInstance

public Expression getInstance()
Return a completly separated copy of this function. The copy does no longer share any changeable objects with the original function.

Specified by:
getInstance in interface Expression
Overrides:
getInstance in class AbstractExpression
Returns:
a copy of this function.

getValue

public Object getValue()
Description copied from class: PageFunction
Returns the page number (function value).

Specified by:
getValue in interface Expression
Overrides:
getValue in class PageFunction
Returns:
the page number.