|
||||||||||
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.TotalGroupSumQuotientFunction
public class TotalGroupSumQuotientFunction
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: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 Summary | |
---|---|
TotalGroupSumQuotientFunction()
Constructs a new function. |
Method Summary | |
---|---|
Object |
clone()
Clones the expression. |
String |
getDividend()
Returns the field used as dividend by the function. |
String |
getDivisor()
Returns the field used as divisor by the function. |
String |
getGroup()
Returns the name of the group to be totalled. |
int |
getRoundingMode()
Returns the defined rounding mode. |
int |
getScale()
Returns the scale for the divide-operation. |
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 |
setDependencyLevel(int level)
Defines the function's dependency level. |
void |
setDividend(String dividend)
Sets the field name to be used as dividend for the function. |
void |
setDivisor(String divisor)
Sets the field name to be used as divisor for the function. |
void |
setGroup(String group)
Defines the name of the group to be totalled. |
void |
setRoundingMode(int roundingMode)
Defines the rounding mode. |
void |
setRuntime(ExpressionRuntime runtime)
Defines the ExpressionRune used in this expression. |
void |
setScale(int scale)
Defines the scale for the divide-operation. |
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 |
---|
getDataRow, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setActive, setName, setPreserve |
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 |
---|
getDataRow, getDependencyLevel, getInstance, getName, getReportConfiguration, getResourceBundleFactory, getRuntime, isActive, isDeepTraversing, isPreserve, setName |
Constructor Detail |
---|
public TotalGroupSumQuotientFunction()
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()
public void setGroup(String group)
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.
public String getDividend()
The field name corresponds to a column name in the report's data-row.
public String getDivisor()
The field name corresponds to a column name in the report's data row.
public void setDividend(String dividend)
The field name corresponds to a column name in the report's data-row.
dividend
- the field name (null not permitted).public void setDivisor(String divisor)
The field name corresponds to a column name in the report's data-row.
divisor
- the field name (null not permitted).public int getRoundingMode()
BigDecimal.divide(java.math.BigDecimal,int)
public void setRoundingMode(int roundingMode)
roundingMode
- the rounding mode.BigDecimal.divide(java.math.BigDecimal,int)
public int getScale()
public void setScale(int scale)
scale
- the scale.public void setDependencyLevel(int level)
setDependencyLevel
in interface Expression
setDependencyLevel
in class AbstractExpression
level
- the dependency level.Expression.getDependencyLevel()
public void setRuntime(ExpressionRuntime runtime)
setRuntime
in interface Expression
setRuntime
in class AbstractExpression
runtime
- the runtime information for the expressionpublic Object clone() throws CloneNotSupportedException
AbstractExpression
Expressions maintain no state, cloning is done at the beginning of the report processing to disconnect the expression from any other object space.
clone
in interface Expression
clone
in class AbstractExpression
CloneNotSupportedException
- this should never happen.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |