BigDecimal Currency Money Charts Ireport

Hi i have a chart where i want to show a label in this format "R$1.235,00" .At the chart i have a field  $F{soma} that is a BigDecimal. If i print just $F{soma} i'm getting something like: "1.235,00".And like  i said i need it like "R$1.235,00".

I've tred  this:

new java.text.DecimalFormat("R$ #,##0.00").format($F{soma})

But then i get this exception:

java.lang.String cannot be cast to java.lang.Number

How can i solve that, can anyone help?Thanks.

MYsql database and the type of soma is in java class is Bigdecimal, and at the database it says decimal(19,2).

I was told that printing just $F{soma} it shouldn't format the soma as "1.235,00". So i gues it have something to do with my database.

ll.rodrigo's picture
Joined: Mar 25 2015 - 10:55pm
Last seen: 6 years 5 months ago

1 Answer:

Hi,
This is a long shot but have you tried;
"R$ " + $F{soma}

As for the pattern of Soma, you can click on the field and give it a pattern in the property.
Regards,
KKriplani

kkriplani's picture
4684
Joined: Sep 4 2015 - 2:18am
Last seen: 9 months 3 weeks ago
Feedback
randomness