Good Day All,
can anybody help me on this. I try to make an if else expression ($F{OUT_STATUS} .equals("40") ? "Applied": "Failed" ). Main main pioint is if the Out_status data is 40 it will show Applied and other than that are failed. however when i run my report it just show Failed for all data. Note that the Out_status datatype is int and i also have try to chage it to ($F{OUT_STATUS} .equals(40) ? "Applied": "Failed" ) but the result are same. Its my first time using jasper. Before this im a crystal developer.
Thank You
Best Regards
1 Answer:
If your field is type of Integer you should use an Integer expression instead:
$F{OUT_STATUS}.intValue() == 40?"Applied":"Failed"
Be sure that your field is not null, otherwise use this:
$F{OUT_STATUS} == null || $F{OUT_STATUS}.intValue() != 40?"Failed":"Applied"
hth + regards from Germany
C-Box
Thank You sir, It really help me.
Good evening!
What aboot if the field from the database is a boolean?
Thank you
Boolean.TRUE.equals($F{YourBoolField}) ?"Write Static YES as its just true": "Write Static NO as its null or false"
hth
C-Box