seshasaib Posted November 20, 2006 Share Posted November 20, 2006 Hi, I have a texfield which displays the date in the format of oracle.sql.TIMESTAMP@132F12 When tried to change the textfield expression class from java.lang.String to java.sql.TIMESTAMP. I am getting the above error. net.sf.jasperreports.engine.JRException: Errors were encountered when compiling report expressions class file: 1. Cannot cast from String to Timestamp value = (java.sql.Timestamp)(""+((oracle.sql.TIMESTAMP)field_CREATION_DATE.getValue())); <-----------------------------------------------------------------------------> 2. Cannot cast from String to Timestamp value = (java.sql.Timestamp)(""+((oracle.sql.TIMESTAMP)field_CREATION_DATE.getOldValue())); <--------------------------------------------------------------------------------> 3. Cannot cast from String to Timestamp value = (java.sql.Timestamp)(""+((oracle.sql.TIMESTAMP)field_CREATION_DATE.getValue())); <-----------------------------------------------------------------------------> 3 errors at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:193) at net.sf.jasperreports.engine.design.JRDefaultCompiler.compileReport(JRDefaultCompiler.java:105) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:127) at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:109) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:510) at java.lang.Thread.run(Thread.java:534) Any ideas why its behaving like this. I am using iReport1.2.8 and jaspereports1.2.8 the version really doesnt matter coz its comming in allmost all the versions that i have seen. Thanks and regards, Sesha sai. Link to comment Share on other sites More sharing options...
lilyjung Posted February 9, 2007 Share Posted February 9, 2007 Try setting your field as: java.sql.Timestamp Then set your text field expression class as:java.lang.String In the Text Field Expression, type:new SimpleDateFormat( "yyyy/MM/dd hh:mm:ss") .format($F{FIELD}) Link to comment Share on other sites More sharing options...
seshasaib Posted February 9, 2007 Author Share Posted February 9, 2007 Hi, thanks for ur reply. That issue is solved by making it as java.lang.String. 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