Jasper Reports casting Integer to BigDecimal with sqlite datasource

Viewed 20

I am working with my jasper reports with a subreport returning a currency value to the main report. The current value that should be returned and displayed to the main report is 900

I keep having an error

Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal

When I change the value having a decimal like 900.10, the error is Caused by: java.lang.ClassCastException: java.lang.Double cannot be cast to java.math.BigDecimal

I have no issues when I am using MySQL as my datasource but whenever I switch to SQLite. I'm having problems regarding the field types, especially with Big Decimals (I use Big Decimal coz I believe it is the correct data type to be used in storing currency values.)

I am working on a portable version of my app which is why I changed its database to SQLite.

How can I convert Integer value to BigDecimal?

0 Answers
Related