Jump to content

java.math.BigDecimal in CT- shows 0 instead of ""


Recommended Posts

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

  • Replies 14
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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

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

$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

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

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

  • 3 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...