Jump to content
We've recently updated our Privacy Statement, available here ×

'net.sf.jasperreports.engine.JRException: Unable to get value for Excel field


jkeri

Recommended Posts

in my Excel sheet i have an AMOUNT field. The cell is defined /formatted as a NUMBER.  The first line in the EXCEL is the header with the column headings. Data starts on the second line.

In my jasper repoprt , by default, the AMOUNT field is defined as 'java.lang.String'.       When I run the report i keep getting   'net.sf.jasperreports.engine.JRException: Unable to get value for Excel field "AMOUNT" of class java.lang.String' error.      I have tried all other types of classes, ; big decimal, integer, long.,short, float, none of them seem to work.

Anyone have any idea as to what class i should assign to the AMOUNT filed?

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Ok,, here is what i did for the AMOUNT field.  I chnaged it from class type 'java.lang.String' to 'java.lang.Integer'.      This works!!!!

Now I have the same type of issue with a date field.

It is defined in EXCEL as 'CUSTOM' with a mask of' m/d/yyyy h:mm:ss AM/PM'.     I am not sure what the Class Type would be in Jasper.      I tried 'java.sql.Date' and a pattern of' MM/DD/yyyy'.  Any suggestions?

 

Link to comment
Share on other sites

  • 1 year 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...