Search code examples
jxls

what is the syntax for jx:each within jx:each in jxls2


I've been using jxls 1.0.5 for a while, and just recently saw a need to migrate to 2.2.5,

in jxls 1.0.5 i'm able to embed a statement within another statement.

<jx:forEach items="${homeDwellers}" var="homeDweller">
<jx:forEach items="${homeDweller.chores}" var="chore">
</jx:forEach>
</jx:forEach>

How is this done with 2.2.5 where i'm only entering a comment for jx:each?

A1: jx:each(items="homeDwellers" var="homeDweller" lastCell="B3")
A2: jx:each(items="homeDweller.chores" var="chore" lastCell="B2")

??


Solution

  • You can define as many inner commands as you need in a single multi-line cell comment

    jx:each(items="homeDwellers" var="homeDweller" lastCell="B3")
    jx:each(items="homeDweller.chores" var="chore" lastCell="B2")
    

    They will be embedded in that same order. See similar example in the documentation.

    Also you may want to check a comment_markup_demo.xls template in jxls-demo project which demonstrates various markup options.