matthew.friendars.usda.go Posted August 9, 2021 Share Posted August 9, 2021 Hi Folks: I have a report that the user would like the 0's to display as a blank cell. I tried setting the cell to display null if blank, but that didn't work so I think I need to tell Jaspersoft to not display the 0.The Cell expression is: $V{ANIMALS_MEASURE} the type of the cell/data is: java.math.BigDecimalust as an example, here is what the report looks like:Thank you for any help,Matthew Link to comment Share on other sites More sharing options...
luked Posted August 9, 2021 Share Posted August 9, 2021 Hi there,Sorry I am unable to see your attachment. Can you try using a print when expression, for example print when $V{ANIMALS_MEASURE}>=1. Link to comment Share on other sites More sharing options...
matthew.friendars.usda.go Posted August 9, 2021 Author Share Posted August 9, 2021 Hi Luked:Thank you for the help. I'm probably putting the expression in the wrong place or I'm missing something. When I try to run it I get an error. In the pic below it shows where I stuck it. :) Link to comment Share on other sites More sharing options...
zellers Posted August 10, 2021 Share Posted August 10, 2021 How about this as cell expression:$V{ANIMALS_MEASURE} == new BigDecimal(0) ? null : $V{ANIMALS_MEASURE}[/code]and "Blank When NULL" ticked ? Link to comment Share on other sites More sharing options...
matthew.friendars.usda.go Posted August 10, 2021 Author Share Posted August 10, 2021 Zellers that was sooo close. It ran for a while so I thought it was going to work, but at the very end gave this error:java.lang.ClassCastException: class java.math.BigDecimal cannot be cast to class java.lang.Boolean (java.math.BigDecimal and java.lang.Boolean are in module java.base of loader 'bootstrap') Link to comment Share on other sites More sharing options...
zellers Posted August 11, 2021 Share Posted August 11, 2021 I think you used my expression as "Print When" while it's meant to be a Text Field expression with "Blank When NULL" checked. Link to comment Share on other sites More sharing options...
matthew.friendars.usda.go Posted August 11, 2021 Author Share Posted August 11, 2021 Thank you for trying to help Zellers. I deleted it to the Expression box and it doesn't give any errors... but it doesn't seem to do anything (the fields that have the 0's all still have 0's. (It just shows the $V in the pic so I moved my mouse over it so it would display the whole line I have in the expression box.Thank you for any help :) 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