navi79 Posted July 8, 2011 Share Posted July 8, 2011 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 More sharing options...
jmurray Posted July 11, 2011 Share Posted July 11, 2011 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:52Post Edited by jmurray at 07/11/2011 20:57 Link to comment Share on other sites More sharing options...
jmurray Posted July 11, 2011 Share Posted July 11, 2011 Naveen, can you post the xml relating to your variable declaration and the section of the report where the variable is is used please? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now