Jump to content
Changes to the Jaspersoft community edition download ×

How to use folmula in iReport?


Recommended Posts



I want to use print experssion in my reports:


( $V{salary}>0 ? "test1" : "test2" )


but I got this problem :


"The operator > is undefined for the argument type(s)

Long, int"


How can I use arithmetic oprand in this expression?


Is it possible to hide a staic text in iReport according

to the conditoion?


Please help me to solve my problems.

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic



Note that by report expressions are Java expressions (by default). Your expression is not a correct Java expressions.


You should use:



$V{salary}.intValue() > 0 ? "test1" : "test2


Testing the salary variable for null in the condition should also be appropriate.


I hope this helps.


Link to comment
Share on other sites

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...