ctayloramericanri.com Posted February 3, 2007 Share Posted February 3, 2007 I know I shouldn't be running into this problem so it's probably something I'm doing. I have a query that has two fields: dateStart and dateEnd which are defined as TimeStamps. The report compiles and executes fine when run without these fields being placed. When these fields are placed I get the following errors: --Error filling print... Unable to get value for field 'dateStart' of class 'java.sql.Timestamp' net.sf.jasperreports.engine.JRException: Unable to get value for field 'dateStart' of class 'java.sql.Timestamp' at net.sf.jasperreports.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:314) at net.sf.jasperreports.engine.fill.JRFillDataset.setOldValues(JRFillDataset.java:799)-snip- I have checked the field being placed and the properties -> Textfield tabs has the following populated: Text Field Expression Class: java.sql.TimeStampEvaluation Time: Now Evaluation Group: ----Text Field Expression: $F{dateStart} The dateStart field is in the query and is showing up under data->report Query as a regular sql query. The dateStart is showing up in the list of field names contained within the query. Link to comment Share on other sites More sharing options...
murthy2005 Posted February 7, 2007 Share Posted February 7, 2007 Hi, I too face the similar problem (jasper 1.2.2). Unable to get value for field 'bank_date' of class 'java.util.Date' Can anybody help me to fix this problem ? Thanks ! Link to comment Share on other sites More sharing options...
ctayloramericanri.com Posted February 7, 2007 Author Share Posted February 7, 2007 The only solution/work-around I've found so far is to conditionally check if it's null and to cast the date field to a string field using the mysql (in my case) date functions. It doesn't appear that date formatting is properly handled in JasperReports. I would have expected to see something earlier regarding this issue so I'm going to assume it's a new one or unique to my platform albeit I'm not using anything out of the ordinary: MySql, JasperIntelligence, iReport. Link to comment Share on other sites More sharing options...
daudo Posted February 19, 2007 Share Posted February 19, 2007 This is an issue that is quite old. To easily work it around you have to modify your JDBC connect string: jdbc:mysql://$SERVER/$DATABASE?zeroDateTimeBehavior=convertToNull Link to comment Share on other sites More sharing options...
shashankgolla Posted May 13, 2013 Share Posted May 13, 2013 I found an easy solution to this:Just make sure you go into your Report Inspector and change whatever field is giving you the errors Field Class to java.lang.String under the Fields and make sure you do the same under the Detail 1 as well. Good luck! Link to comment Share on other sites More sharing options...
pauloc.martins Posted September 8, 2013 Share Posted September 8, 2013 that great solution with adding "?zeroDateTimeBehavior=convertToNull" into JDBC url. It works with iReport and Eclipse DataBase Explorer. Link to comment Share on other sites More sharing options...
pauloc.martins Posted September 8, 2013 Share Posted September 8, 2013 that great solution with adding "?zeroDateTimeBehavior=convertToNull" into JDBC url. It works with iReport and Eclipse DataBase Explorer. Link to comment Share on other sites More sharing options...
gleycer1 Posted July 27, 2016 Share Posted July 27, 2016 My english is really bad, but I needed to give yourself thanks. Link to comment Share on other sites More sharing options...
fnamelnamefn Posted December 8, 2016 Share Posted December 8, 2016 Works like charm in new jasper studio also Link to comment Share on other sites More sharing options...
ewa.sliwinska Posted April 10, 2020 Share Posted April 10, 2020 Does not seem to work with Oracle. Do you have any reference to this bug in bugtracker? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now