Jump to content
We've recently updated our Privacy Statement, available here ×

If Else In Expression Editor


railey.shah

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

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

Link to comment
Share on other sites

  • 2 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...