Jump to content
Changes to the Jaspersoft community edition download ×

Errro retrieving TIME values


Recommended Posts

By: anton_phil - anton_phil

Errro retrieving TIME values

2005-04-11 19:56

Hi,

 

I've been using iReport for couple of months now and its my first time to encounter an error regarding TIME values save in a PostGresSGQ database. I have a field in table A that is of TIME property in POstGreSql. Stores TIME values. eg: 13:23:23 (1:23:23 pm). I've created Report A using Report wizzard with, say the ff query SELECT * FROM "table".

Afterwhich it correctly displays the required fields. When you click on the TIME field that the report has made, it has the Textfield Expression Class = java.util.Date by default.

But when you run the report with database data included an error comes up..

 

 

net.sf.jasperreports.engine.JRException: Unable to get value for field 'Time' of class 'java.util.Date'

 

 

Any input guys?

 

 

Thanks in advance

 

 

 

 

 

Filling report... Error filling print... java.lang.StringIndexOutOfBoundsException: String index out of range: 10 at java.lang.String.substring(String.java:1441) at org.postgresql.jdbc2.ResultSet.toDate(ResultSet.java:1570) at org.postgresql.jdbc2.ResultSet.getDate(ResultSet.java:372) at org.postgresql.jdbc2.ResultSet.getDate(ResultSet.java:607) at net.sf.jasperreports.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:164) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:890) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:160) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:691) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:519) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:120) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:291) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:207) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:521) at java.lang.Thread.run(Thread.java:534) NESTED BY : java.lang.StringIndexOutOfBoundsException: String index out of range: 10 at java.lang.String.substring(String.java:1441) at org.postgresql.jdbc2.ResultSet.toDate(ResultSet.java:1570) at org.postgresql.jdbc2.ResultSet.getDate(ResultSet.java:372) at org.postgresql.jdbc2.ResultSet.getDate(ResultSet.java:607) at net.sf.jasperreports.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:164) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:890) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:160) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:691) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:519) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:120) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:291) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:207) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:521) at java.lang.Thread.run(Thread.java:534) NESTED BY : net.sf.jasperreports.engine.JRException: Unable to get value for field 'Time' of class 'java.util.Date' at net.sf.jasperreports.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:279) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:890) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:160) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:691) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:519) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:120) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:291) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:207) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:521) at java.lang.Thread.run(Thread.java:534) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 10 at java.lang.String.substring(String.java:1441) at org.postgresql.jdbc2.ResultSet.toDate(ResultSet.java:1570) at org.postgresql.jdbc2.ResultSet.getDate(ResultSet.java:372) at org.postgresql.jdbc2.ResultSet.getDate(ResultSet.java:607) at net.sf.jasperreports.engine.JRResultSetDataSource.getFieldValue(JRResultSetDataSource.java:164) ... 9 more

 

 

By: Daren O - rckrll106

RE: Errro retrieving TIME values

2005-04-12 06:31

It appears in Misc.java the method getJdbcTypeClass is setting date and time to date.

 

case java.sql.Types.DATE:

case java.sql.Types.TIME:

cls = "java.util.Date";

 

Not sure why but seems like the problem. Maybe there is a reason or maybe this can be fixed in the next version.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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