Java.math.BigDecimal cannot be cast to java.lang.String error when running Jasper iReport

Jaspersoft Community 'Read-Only' as of July 8, 2022

Transition to New TIBCO Community Just Weeks Away

You can still search, review wiki content, and review discussions in read-only mode. Please email community@tibco.com with questions or issues requiring TIBCO review or response.

Jasper iReport Designer Professional 5.6

When running my chart report I get this error:

**Error filling print... java.math.BigDecimal cannot be cast to java.lang.String ......Print not filled.

The variable I'm using is pulled from an Oracle database and is a BigDecimal data type. In my Value Expression, I'm setting the Value Class Name as java.math.BigDecimal as well. I've tried passing the variable as a string and that doesn't work either.

Does anyone have any thoughts on how I can get past this error?

reggiereg's picture
Joined: Feb 23 2015 - 6:03pm
Last seen: 7 years 3 months ago

Hi reggiereg,

I had to face these kind of errors a while ago, i had fixed it with adding blank string to the String variable passing. Somthing like below.

BigDecimal testNum = new BigDecimal("29.87");
String str = testNum + "";
 
Hope this will help, if not provide full jrxml for debugging.
jog_1 - 7 years 3 months ago

1 Answer:

Hi reggiereg,

I had to face these kind of errors a while ago, i had fixed it with adding blank string to the String variable passing. Somthing like below.

BigDecimal testNum = new BigDecimal("29.87");
String str = testNum + "";
 
Hope this will help, if not provide full jrxml for debugging.
jog_1's picture
71
Joined: Mar 23 2015 - 4:16am
Last seen: 4 years 11 months ago
Feedback
randomness