Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

Definition

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

Note: Release 0.8.9-ga is not working with JavaScript due to a Jar-Version conflict. To resolve it, upgrade to BSF-2.4.0 and Rhino-1.6r7.

The expression will use the last statement as return value. This statement must either be an dummy assignment statement or a method/function call that returns a value.

Examples

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