markos17 Posted May 12, 2010 Share Posted May 12, 2010 I use Crosstable in which i show some values in different periods. I used to use Java.lang.string and eveyrthing was ok. When in database position didn't have any value, then in report it was the same. Last time, I wanted to use summary column, that'd sum all values in rows and columns. I had to change type to java.math.Bigdecimal. Since then instead of " ", it shows 0. Is there any way to solve it out? Link to comment Share on other sites More sharing options...
giulio Posted May 12, 2010 Share Posted May 12, 2010 Use this expression:($V{your_value} == 0) ? null : $V{your_value}and then set the Blank when null checkbox.Now, can you read this post? It's very important:http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101&topicid=74332Thanks a lotGiulio Link to comment Share on other sites More sharing options...
markos17 Posted May 13, 2010 Author Share Posted May 13, 2010 unfortunately, I have errors with types. how can i cast 0 from Int to BigDecimal? java:154: incomparable types: java.math.BigDecimal and int value = (java.math.BigDecimal)((((java.math.BigDecimal)variable_wylMeasure.getValue()) == 0) ? null Link to comment Share on other sites More sharing options...
slow Posted May 13, 2010 Share Posted May 13, 2010 suppose A is an int and B is a BigDecimal :B = new BigDecimal(A); so... new BigDecimal(0) Post Edited by slow at 05/13/2010 09:35 Link to comment Share on other sites More sharing options...
markos17 Posted May 13, 2010 Author Share Posted May 13, 2010 thanks for the hint. It doesn't show error any more, but also still doesn't bring any effect.Now the formula is: ($V{wylMeasure} == new BigDecimal(0)) ? null : $V{wylMeasure}but still shows "0"It looks like, the formula can't find the "0". When I swaped formula into:($V{wylMeasure} == new BigDecimal(0)) ? $V{wylMeasure} : null then all cell are empty. I also tried many other combination, like new BigDecimal("0") and so on..When I change BigDecimal into String, then it works fine, show empty cells instead of "0", but the in the TOTAL column there are values from the previous column. I attach Excel File with an example. Any ideas, as I'm startin to give up :/Post Edited by markos17 at 05/13/2010 11:12 Link to comment Share on other sites More sharing options...
slow Posted May 13, 2010 Share Posted May 13, 2010 $V{wylMeasure} in a BigDecimal?then use:($V{wylMeasure}.intValue() ==0) ? null : $V{wylMeasure} _________________________________________if it works... give me KARMA points please! : ) _________________________________________ listening: Underworld - Beautiful Burnout Link to comment Share on other sites More sharing options...
markos17 Posted May 13, 2010 Author Share Posted May 13, 2010 It almost works! There is just one issue. It also cut off cells with actual value of zero: "0.0000". Link to comment Share on other sites More sharing options...
slow Posted May 13, 2010 Share Posted May 13, 2010 ehm... you must implement a logic to distinguish the value 0 from the "real" value 0... as you want...a miracle in informatic doesn't exists... so use your fantasy :) Link to comment Share on other sites More sharing options...
markos17 Posted May 13, 2010 Author Share Posted May 13, 2010 hehe, i know that distinguishing is a matter, but any clues, how to help my fantasy :) Link to comment Share on other sites More sharing options...
slow Posted May 13, 2010 Share Posted May 13, 2010 try to draw a table indicating which fields you want to see and what not, perhaps it would be more easily give you an idea rather than trying to give in general, maybe wrong ...also ask questions is an art, right?:) Link to comment Share on other sites More sharing options...
markos17 Posted May 13, 2010 Author Share Posted May 13, 2010 sure, sure :) i'm attaching Excel Link to comment Share on other sites More sharing options...
markos17 Posted May 13, 2010 Author Share Posted May 13, 2010 delete Post Edited by markos17 at 05/13/2010 14:12 Link to comment Share on other sites More sharing options...
slow Posted May 13, 2010 Share Posted May 13, 2010 Unfortunately you are not clear ...I'm going to go away from work so 'can not investigate further.However, you could use instead of BigDecimal textfield , you can use texfield of type String and set the value of the string (which contains 0)you don't want to see to "" and "0" the others... Link to comment Share on other sites More sharing options...
markos17 Posted May 13, 2010 Author Share Posted May 13, 2010 ok, it works now. I use such formula:($V{wylMeasure}.toPlainString() == "0") ? null: $V{wylMeasure} Thanks a lot!!! Link to comment Share on other sites More sharing options...
cjasper Posted June 26, 2013 Share Posted June 26, 2013 This works but it leaves a blank space in place of the null row group.I am using $V{your_value} as row group.I have tried setting the property of totals to float but the gap remains. Any idea ? 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