Reputation: 4309
Is it possible to use an if / elseif / elseif / ... / else construct with JXLS?
In the docu I see
jx:if(condition="employee.payment <= 2000", lastCell="F9", areas=["A9:F9","A18:F18"])
I already used it and it works fine. But, taking this example, I want another area for when my employee has a payment of <= 4000, and another if he has <= 10000.
How would I accomplish that? It seems to me that there is only a if / else possible?
Upvotes: 2
Views: 4040
Reputation: 163
I tried to do nested "if-else" commands.
I had to fill a doc with skill names. The list of skills was hierarchical. The first level skills were bold with dark background. Any other skill with children was with lightgray background. And any other skill was with common style. So I did a kind of chaining of "if-else" commands.
The first comment (B2) is:
jx:if(condition="skill.withChildren", lastCell="E2", areas=["B3:E3","B5:E5"])
The second (B3) is:
jx:if(condition="skill.level==1", lastCell="E3", areas=["B3:E3","B4:E4"])
(A1) has this:
jx:area(lastCell="E5")
(A2) has this:
jx:each(items="skills" var="skill" lastCell="E2")
Upvotes: 1
Reputation: 1264
There is no built-in support for the if-elseif-else construct.
You can raise an improvement request in jxls issue tracker for future releases.
As a workaround you can try the following approaches
Upvotes: 1