Hello,
I am searching for the best way to do the following:
I want to iterate about my beans and use an excel template.
Map<String, _Collection_> beans = *new*HashMap<String,
_Collection_>();
// ..
beans.put("nutzer", nutzer);
XLSTransformer transformer = *new*XLSTransformer();
transformer.transformXLS(/templateFileName/, beans, outputFileName);
Each item of the collection nutzershould be in a new row.
<jx:forEach items="${nutzer}" var="n">
Text | ${n.getName()} | .... | ..
</jx:forEach>
Every item 'n' contains another collection 'coll'. I do not know the
number of item in 'coll' at compile time, but I want to have each item
in a new columm.
<jx:forEach items="${nutzer}" var="n">
Text | ${n.getName()} | .... | <jx:forEach items="${ ???}" var="zelle">
| ${zelle} | </jx:forEach>
</jx:forEach>
My problem is to find the correct expression in the inner forEach.
I have an method called 'calcColl' which returns a Collection<String>,
but it is not allowed to write
<jx:forEach items="${ n.calcColl()}" var="zelle">, isn't it ?
Next try :
I created a private field 'coll' and a 'getColl()' method :
*public*Collection<String> getColl(){
coll= calcColl();
*return*coll;
}
And wrote :
<jx:forEach items="${ n.coll}" var="zelle">
But this also did not work. Now I am confused, because if I instantiate
'coll' in the constructor with data and use
*public*Collection<String> getColl(){
*return*coll;
}
everything is fine. Unfortunately I have to calculate 'coll' at a later
time.
What am I doing wrong ?
Best regards and thanks for the great library
Florian
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
jXLS-user mailing list
jXLS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jxls-user