bhanuchandharchalla Posted June 6, 2013 Share Posted June 6, 2013 Hi All,I have an issue regarding Text Field expression.1. by using SUM(Y) in database, getting integer value for SUM_Y Field in iReport. ( I have made a Field in Fields list)2. Here I need to display Integer value coming from database in my Report By using following expression : [ $F{SUM_Y} != null ? $F{SUM_Y} : ""]But i'm getting below the compilation error.Incompatible conditional operand types Integer and int value = (java.lang.Integer)(((java.lang.Integer)field_SUM_Y.getValue()) == null ? ((java.lang.Integer)field_SUM_Y.getValue()) : 0); //$JR_EXPR_ID=43$ <----------------------------------------------------------------------------------------------------->Please help on above the issue.Thanks in Advance. Link to comment Share on other sites More sharing options...
Thomas Zimmer Posted June 6, 2013 Share Posted June 6, 2013 which version are you using?however, as the expression seems to expect an "Integer", not an "int", the expression should be:$F{SUM_Y} != null ? $F{SUM_Y} : new Integer(0)My recommendation would be, use a substitution in your query, not in the report, like "... NVL(SUM(...), 0) as SUM_Y..."Cheers, Thomashttp://www.thomaszimmer.net Link to comment Share on other sites More sharing options...
bhanuchandharchalla Posted June 7, 2013 Author Share Posted June 7, 2013 It worked for me 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