andrew_50 Posted November 6 Posted November 6 I have a Jasper Report which was functioning just fine, but now is (when I ask it for a preview) giving me this error I am usingJaspersoft Studio 6.19.1 - Community Edition on Ubuntu 22.04 I see some other people that said it "worked again" by just restarting Studio, or putting the report in a new project That is not working for me. Help! net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: DATEFORMAT( $F{theDate}, "dd-MMM-yy" ) at com.jaspersoft.studio.editor.preview.view.control.ReportController.fillReport(ReportController.java:553) at com.jaspersoft.studio.editor.preview.view.control.ReportController.access$18(ReportController.java:528) at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:446) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) Caused by: net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: DATEFORMAT( $F{theDate}, "dd-MMM-yy" ) at net.sf.jasperreports.engine.fill.JREvaluator.handleEvaluationException(JREvaluator.java:294) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:328) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:673) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:641) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:1175) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluateText(JRFillTextField.java:555) at net.sf.jasperreports.engine.fill.JRFillTextField.evaluate(JRFillTextField.java:540) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:383) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:548) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2613) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:836) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:275) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:119) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:622) at net.sf.jasperreports.engine.fill.BaseFillHandle$ReportFill.run(BaseFillHandle.java:135) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.UnsupportedOperationException at java.sql/java.sql.Date.toInstant(Unknown Source) at net.sf.jasperreports.functions.standard.DateTimeFunctions.DATEFORMAT(DateTimeFunctions.java:603) at ULx32KCDO32APPLIANCE32LABELS_1730919050058_664529.DATEFORMAT(ULx32KCDO32APPLIANCE32LABELS_1730919050058_664529:151) at ULx32KCDO32APPLIANCE32LABELS_1730919050058_664529.evaluate(ULx32KCDO32APPLIANCE32LABELS_1730919050058_664529:79) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:313) ... 14 more
Lucian Chirita Posted November 7 Posted November 7 The DATEFORMAT problem was fixed in JasperReports/Jaspersoft Studio 6.20.0, see the commit. So you'll need to upgrade to a version newer than 6.19.1. Regards, Lucian
andrew_50 Posted November 7 Author Posted November 7 Weird. But why would it initially work, and then fail? Heavy is the weight upon the head that likely has to "fix" a lot of reports.
shreekrishna.shankhwar Posted November 21 Posted November 21 It look like you are using some scriptlet function. I would recomend add that jar in your studio that should work. or you can replace that with new SimpleDateFormat() function . If data coming in string new SimpleDateFormat("dd/MM/yyyy").format(new SimpleDateFormat("yyyy-MM-dd").parse("2016-01-30")); if data coming in date new SimpleDateFormat("dd-MMM-yy").format( $F{theDate});
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