PercentageExpression

Definition

Computes the percentage for a column in relation to a base column.

The function understands two parameters.

  • dividend parameter is required and denotes the name of an Item Section field which is used as dividend.
  • divisor parameter is required and denotes the name of an Item Section field which is used as divisor.

If either the dividend or the divisor are not numeric, the expression will return null.

The formula used is as follows, Percent := divident / divisor.
If the flag useDifference is set, the difference between base and subject is used instead. Percent := (divisor - divident) / divisor

Example

<expression name="saved" class="org.jfree.report.function.PercentageExpression">
  <properties>
    <property name="dividend">article.price</property>
    <property name="divisor">article.reducedPrice</property>
    <property name="useDifference">true</property>
  </properties>
</expression>