jkeri Posted May 3, 2017 Share Posted May 3, 2017 I created my first crosstab report and some of the cells have zero value and its printing a zero.. I want the cell to be blank if its a zero. Im not a Java devloper, is there any way I can supress the zero values? Link to comment Share on other sites More sharing options...
lisaws Posted May 3, 2017 Share Posted May 3, 2017 You can use an expression:$F{field} == 0 ? "" : $F{field}Which reads "If value is zero, print blank cell. Otherwise print the value" Link to comment Share on other sites More sharing options...
lisaws Posted May 3, 2017 Share Posted May 3, 2017 deleted Link to comment Share on other sites More sharing options...
nessrineselmi215 Posted May 3, 2017 Share Posted May 3, 2017 hi lisazollwakanacan u help me to resolve my problemHow to modify a report template ".jasper"??? Link to comment Share on other sites More sharing options...
jkeri Posted May 3, 2017 Author Share Posted May 3, 2017 I just checked my code, looks like the field i want is a measured field $V{AMOUNT_MEASURE} == 0? "":$V{AMOUNT_MEASURE} if the value is zero then print blanks. When i do this expression i get 'incompatiable operands types BigDecimcal and int' Link to comment Share on other sites More sharing options...
lisaws Posted May 3, 2017 Share Posted May 3, 2017 How about: $V{AMOUNT_MEASURE}.equals(0)? "":$V{AMOUNT_MEASURE} Link to comment Share on other sites More sharing options...
jkeri Posted May 4, 2017 Author Share Posted May 4, 2017 $V{AMOUNT_MEASURE}.equals(0)? "":$V{AMOUNT_MEASURE} I tried that ExPRESSION and got : java.math.BigDecimal cannot be cast to java.lang.String error Link to comment Share on other sites More sharing options...
jkeri Posted May 4, 2017 Author Share Posted May 4, 2017 This is the correct EXPRESSION that i needed: new Boolean($V{AMOUNT_MEASURE}.toString().equals("0"))? " ":$V{AMOUNT_MEASURE} This work... thank you for pointing me in the right direction and your time. 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