Class TotalGroupSumQuotientPercentFunction
- 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.TotalGroupSumQuotientFunction
-
- org.pentaho.reporting.engine.classic.core.function.TotalGroupSumQuotientPercentFunction
-
- All Implemented Interfaces:
Serializable
,Cloneable
,EventListener
,ReportListener
,Expression
,Function
public class TotalGroupSumQuotientPercentFunction extends TotalGroupSumQuotientFunction
A report function that calculates the quotient of two summed fields (columns) 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:- to calculate a quotient for the entire report;
- to calculate a quotient within a particular group;
dividend
parameter is required and denotes the name of an ItemBand-field which gets summed up as dividend. Thedivisor
parameter is required and denotes the name of an ItemBand-field which gets summed up as divisor. The parametergroup
denotes the name of a group. When this group is started, the counter gets reseted to null. This parameter is optional. This function scales the computed percentage to 100. A value of 100% will therefore be returned as 100 instead of 1. The result of this function cannot be used together with the percentage operator of the NumberFormat in a Number-field.- Author:
- Thomas Morgner
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TotalGroupSumQuotientPercentFunction()
Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getValue()
Computes the scaled percentage.-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.TotalGroupSumQuotientFunction
clone, getCrosstabFilterGroup, getDividend, getDivisor, getGroup, getRoundingMode, getScale, groupStarted, itemsAdvanced, reportInitialized, setCrosstabFilterGroup, setDependencyLevel, setDividend, setDivisor, setGroup, setRoundingMode, setRuntime, setScale
-
Methods inherited from class org.pentaho.reporting.engine.classic.core.function.AbstractFunction
groupFinished, itemsFinished, itemsStarted, reportDone, reportFinished, reportStarted, summaryRowSelection
-
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, finalize, 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
-
-
-
-
Method Detail
-
getValue
public Object getValue()
Computes the scaled percentage.- Specified by:
getValue
in interfaceExpression
- Overrides:
getValue
in classTotalGroupSumQuotientFunction
- Returns:
- the computed percentage scaled to 100.
-
-