Can i put more than one condition at print when expression? and can pls tell the syntax.
example,
(cb.flag = 'A' or cb.flag = 'B' or cb.flag = 'C') and cb.type <> 'O'
- i need to use OR condition together with AND.
Thanks.
ireportjasper-reports
Can i put more than one condition at print when expression? and can pls tell the syntax.
example,
(cb.flag = 'A' or cb.flag = 'B' or cb.flag = 'C') and cb.type <> 'O'
Thanks.
Best Answer
Syntax is
(condition) ? value1 : value2
In place of value1 and value2 you may have other constraints.Here is an example that uses a Java constraint:
These are Java expressions, so you have to be careful with
==
and=
.Now the print part...
So far you have defined a Variable
variable1
, which is a String variable (could be anything else) and behaves accordingly to the constraint you have defined.You just need to drag it from your the Variables group of your Report Inspector to the zone (most likely the Detail zone) of your report. Then it becomes
$V{variable1}
and prints in your zone whatever the constrain dictates. That's it.