ozkan Posted July 22, 2010 Share Posted July 22, 2010 Hi,My report has a date column. I'm sending a string data to the report date column from my java code.I think, their format is different, the following error.How do I edit the date column, receive as string data. Thanks. net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $F{Date} at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:195) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:589) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:557) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:929) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:383) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:368) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:258) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:499) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2026) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:757) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:269) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:127) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:860) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624) Link to comment Share on other sites More sharing options...
vickirk Posted July 22, 2010 Share Posted July 22, 2010 What's your query? Link to comment Share on other sites More sharing options...
ozkan Posted July 22, 2010 Author Share Posted July 22, 2010 I sent the data from a jtable. When the date out of the column is working properly.I want to change the date format as string in ireport.How can I do? Link to comment Share on other sites More sharing options...
vickirk Posted July 22, 2010 Share Posted July 22, 2010 The error message suggests you don't have a field called Date, what is the source of the data? Assuming it is JDBC what is your SQL query?> I'm sending a string data to the report date column from my java code.I'm a bit confused, could you expand a little. Regards, Vic Link to comment Share on other sites More sharing options...
ozkan Posted July 22, 2010 Author Share Posted July 22, 2010 I'm sending data to the report in a jtable from java code. All of the following data is String in jtable. But Date parameter is sql timestamp in report. So I think it fails. Date parameter should be string type in ireport. How can convert it in ireport? Link to comment Share on other sites More sharing options...
vickirk Posted July 22, 2010 Share Posted July 22, 2010 > I'm sending data to the report in a jtable from java codeSorry, stil confused. Do you have an application that you use to populate data in teh database, that data is then pulled out for a report via JDBC/SQL? > How can convert it in ireport?Change the type of the field to a string. use $F{Date}.toString() or use java.util.SimpleDateFormat. Alternatly change your databse query to return the formatted string.BTW, are you sure you have a field _called_ Date specifed in your query, the error you are report says it cannot evaulate the expression _$F{Date}_ Link to comment Share on other sites More sharing options...
ozkan Posted July 22, 2010 Author Share Posted July 22, 2010 I used the date field as $F{Date}.toString() but gives the same error. net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : $F{Date}.toString() 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