Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Definition

Excerpt

Uses script code from the Apache-BeanScriptingFramework to calculate values within a single row of a report.

Note: Seems not to be working with JavaScript due to a Jar-Version conflict.

Examples

Code Block
xml
xml

<expression class="org.jfree.report.modules.misc.bsf.BSFExpression" name="totalPrice">
  <properties>
    <property name="language">javascript</property>
    <property name="expression">
     Object getValue() { 
       if (dataRow == null) { 
         return null; 
       }      
       var OrderCount = dataRow.get(&quot;QUANTITYORDERED&quot;); 
       var SalePrice = dataRow.get (&quot;PRICEEACH&quot;); 
       if (OrderCount == null || SalePrice == null) { 
         return null;
       }
       float totalPrice = OrderCount * SalePrice;      
       return totalPrice; 
     }
    </property>
   </properties>
</expression>