Introduction

This part describes object property access syntax that must be used in XLS template to be correctly processed by jXLS engine.

Next sections assume that we have two dependent Java beans of type Department and Employee which are passed to XLSTransformer in a code like this

                    Department department;
                    ... //initialization
                    Map beans = new HashMap();
                    beans.put("department", department);
                    XLSTransformer transformer = new XLSTransformer();
                    transformer.transformXLS(xlsTemplateFileName, beans, outputFileName);
            

Basic Property Access

To access simple bean property in Excel cell following notation should be used

					${department.name}
            

jXLS engine will search for the bean under the key department in the current bean map and then will try to get the value of its name property and put it into the corresponding Excel cell.

In the same way we can access more complex property. For example to output the name of the chief of the department we can use

					${department.chief.name}
            

Any object property graph depth is possible. For example,

        ${bean.bean1.bean2.bean3.bean4.bean5.bean6.bean7.bean8.bean9.beanX.property1}
            

Several Properties in a cell

We can concatenate several properties in a cell. For example

					Employee: ${employee.name} - ${employee.age} years
            

In this way we'll get an output like

                    Employee: John - 35 years