Hi,
I have a problem with concatenation of two strings (from query) in a textfield.
I want to concat string A and B with a " - " between them. The "-" is present only if B is not NULL.
I use the following expression in the textfield :
I have a problem with concatenation of two strings (from query) in a textfield.
I want to concat string A and B with a " - " between them. The "-" is present only if B is not NULL.
I use the following expression in the textfield :
Code: |
<br /> (!($F{A}.equals(null)) ? $F{A} : ""«») +<br /> (!($F{B}.equals(null)) ? " - " + $F{B} : ""«») <br /> </td></tr></tbody></table><br /> <br /> But it doesn't work. If B is NULL, nothing is printed (normally A must be printed).<br /> <br /> Can you help me ?<br /> Thanks<br>Post edited by: babarincairo, at: 2006/11/07 08:25 |
3 Answers:
Posted on November 9, 2006 at 8:10am
the folloling code is working
($F{NOT_zone1}) + ($F{NOT_zone2} == null ? "" : " - " + $F{NOT_zone2}) + ($F{NOT_zone4} == null ? "" : " - " + $F{NOT_zone4}) + ($F{NOT_zone5} == null ? "" : " - " + $F{NOT_zone5}) + ($F{NOT_zone6} == null ? "" : " - " + $F{NOT_zone6}) |