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

Problem with null TimeStamp in iReport 1.3.0


ctayloramericanri.com

Recommended Posts

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.TimeStamp

Evaluation 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

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

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

  • 2 weeks later...
  • 6 years later...
  • 3 months later...
  • 2 years later...
  • 4 months later...
  • 3 years 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...