DEV Community

Discussion on: JXLS: How to generate Excel documents using templates?

Collapse
 
codepanja profile image
Atul Kumar PK

I would like to know how to print columns of a row from an array?

For an example, how to write the template for the following object list?

clients: [
names[]
]

I wanna write the names of first client in first row.
How to access the name like ${names[index]} ?????
Could you please share if you know the solution?

Collapse
 
alekyaragipally profile image
alekyaragipally • Edited

you need to specify your array name in items, and give any var name in var, and last cell is the last cell where your data ends
jx:each(items="arrayName" var="anyVarName" lastCell="E5")

Add it as a comment to the first cell of the excel where the dynamic data starts