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

I have problems with Conditional Operator validations in iReports 3.7.2


navi79

Recommended Posts

I have problems with the Conditional operator in iReports 3.7.2. The conditional operator was written as follows on a field to display in a report.

($F{EXTERNALCOMMENTS}.equals("*"))?$V{Vnumericres}+"*":$V{Vnumericres}

where $V{Vnumericres} = ($F{NUMERICRESULT}.toString().length()==1)?"0"+$F{NUMERICRESULT}.toString():($F{NUMERICRESULT}.toString())

The Problem here is the validation has been written in loop and the results are displayed according to the number of records returned by the query. If I use the above conditional operator, only the first value is displaying where as rest of the rows are not displaying any values. If I remove the conditional operator and just write $V{Vnumericres} it is displaying as expected.

Why If I use the conditional operator it is vanishing rest of the results?

Thanks & Regards,

Naveen Kumar G.

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Apologies, I realised after I went to bed that my post.(equals() is ...  ...  use .compareTo() instead:) was incorrect, so I've deleted it.

 Post Edited by jmurray at 07/11/2011 20:52



Post Edited by jmurray at 07/11/2011 20:57
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...