jXLS allows direct access to key POI objects in XLS template. They are available under special bean keys in the bean context map.
Having access to these objects you can invoke different methods to manipulate current template transformation. Next sections show some examples of tasks that can be performed using this approach.
Note: You can change default keys by which POI objects are available in the bean context map using Configuration class
Setting of header and footer messages is easy because org.apache.poi.ss.usermodel.Sheet provides an access to header and footer with
getHeader()
and getFooter()
methods. So the next code
${sheet.getHeader().setLeft('Left Header')}
sets left header of the sheet to 'Left Header' string. Dynamic bean properties also can be used as parameters
${sheet.getFooter().setCenter(msgBean.footer)}
This sample sets center footer message to the value of footer
property of msgBean
bean.