-
Book Overview & Buying
-
Table Of Contents
Pentaho Reporting 3.5 for Java Developers
By :
Another approach to implementing your own report expressions is using the BSHExpression report expression, which uses BeanShell to evaluate an expression. BeanShell is a Java code interpreter, so you can write Java for direct execution within a report with this expression. The BSHExpression contains a property called expression, which should contain the necessary BeanShell script. This script must contain the Object getValue() method, which is called to evaluate the expression. Imports and additional functions may be included in the expression. The expression also has access to the DataRow class instance named dataRow. This allows for easy access to the current row of data for the expression to use.
Open up the already defined chapter11.prpt, defined earlier in this chapter, within Report Designer. Now add a Bean-Scripting-Host (BSH) expression, which is located within the Script function group. Set the expression property to the...
Change the font size
Change margin width
Change background colour