org.pentaho.reporting.engine.classic.core.function.sys
Class SheetNameFunction

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.AbstractElementFormatFunction
              extended by org.pentaho.reporting.engine.classic.core.function.sys.SheetNameFunction
All Implemented Interfaces:
Serializable, Cloneable, EventListener, PageEventListener, ReportListener, Expression, Function, LayoutProcessorFunction, StructureFunction

public class SheetNameFunction
extends AbstractElementFormatFunction
implements StructureFunction

This function is used to generate sheet names into table exports. Sheet names are generated on page breaks and have different representations depending the export type.
To use this functionnality report configuration must set the property DECALRED_SHEETNAME_FUNCTION_KEY to point to an existing function or property accessible within the report.

As for example using simple report definition:

 <report>
   <configuration>
     <!-- where sheetNameExpression is pointing to a valid function declared in this report -->
     <property name="org.pentaho.reporting.engine.classic.core.targets.table.TableWriter.SheetNameFunction">sheetNameExpression</property>
   </configuration>
   ...
 </report>
 
This way of defining a sheetname for elements is deprecated. Sheetnames should be declared or computed directly on the bands by specifiing a sheetname using the "computed-sheetname" style-property.

Author:
Cedric Pronzato
See Also:
Serialized Form

Constructor Summary
SheetNameFunction()
          Default constructor.
 
Method Summary
 int getDependencyLevel()
          Overrides the dependency level to only execute this function on the pagination and content-generation level.
 int getProcessingPriority()
           
 Object getValue()
          Structure functions do not care of the result so this method should never be called.
 void reportInitialized(ReportEvent event)
          Receives notification that report generation initializes the current run.
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractElementFormatFunction
getElement, groupFinished, groupStarted, itemsAdvanced, itemsFinished, itemsStarted, pageFinished, pageStarted, reportFinished, reportStarted, setElement
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
reportDone
 
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractExpression
clone, getDataRow, getInstance, 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, groupStarted, itemsAdvanced, itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted
 
Methods inherited from interface org.pentaho.reporting.engine.classic.core.function.Expression
clone, getDataRow, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setDependencyLevel, setName, setRuntime
 

Constructor Detail

SheetNameFunction

public SheetNameFunction()
Default constructor.

Method Detail

reportInitialized

public void reportInitialized(ReportEvent event)
Description copied from class: AbstractElementFormatFunction
Receives notification that report generation initializes the current run.

The event carries a ReportState.Started state. Use this to initialize the report.

Specified by:
reportInitialized in interface ReportListener
Overrides:
reportInitialized in class AbstractElementFormatFunction
Parameters:
event - The event.

getDependencyLevel

public int getDependencyLevel()
Overrides the dependency level to only execute this function on the pagination and content-generation level.

Specified by:
getDependencyLevel in interface Expression
Overrides:
getDependencyLevel in class AbstractExpression
Returns:
LayoutProcess.LEVEL_PAGINATE.

getProcessingPriority

public int getProcessingPriority()
Specified by:
getProcessingPriority in interface StructureFunction

getValue

public Object getValue()
Structure functions do not care of the result so this method should never be called.

Specified by:
getValue in interface Expression
Overrides:
getValue in class AbstractElementFormatFunction
Returns:
null