POI Objects Exposed

During transformation, several POI objects are exposed in the beans map.

  • cell - The current POI Cell object is exposed in the beans map. This exposes cell properties such as row and column indexes, e.g. This is cell ${jett:cellRef(cell.rowIndex, cell.columnIndex)} => "This is cell B2".
  • sheet - The current POI Sheet object is exposed in the beans map as the bean name "sheet". This allows for Expressions that set "off sheet" properties such as the Header, Footer, and PrintSetup.
  • workbook - The entire POI Workbook object is exposed in the beans map as the bean name "workbook".

Because some of these examples call methods with a return type of "void", the Expressions themselves that do so evaluate to null and the cells that contain them will be blanked out. Note: JEXL Expressions allow String literals to be enclosed in single quotes.

POI Objects Template 1

After transformation, the above group of cells looks like this.

Top of POI Objects Result 1

 

Bottom of POI Objects Result 1

The Header and Footer objects are populated, and they are seen when switching to Excel's "Page Layout" View.

Note that any expressions found in a sheet's name, header, or footer are transformed before the sheet itself is transformed. That means that such expressions as above will overwrite whatever content was there previously, whether it was static content or evaluated expressions.