Jasper Reports "Error evaluating expression for source text:DATEFORMAT($P{p_startdate},"yyyy-MM-dd HH:mm:ss")

book

Article ID: 224327

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager

Issue/Introduction

Customer is trying to generate a custom report in Jasper Reports.

Error found when recreating the error:

net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression for source text: DATEFORMAT($P{p_startdate},"yyyy-MM-dd HH:mm:ss")
 at net.sf.jasperreports.engine.fill.JREvaluator.handleEvaluationException(JREvaluator.java:284)
 at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:316)
 at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:672)
 at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:640)
 at net.sf.jasperreports.engine.fill.JRFillDataset.evaluateParameterValues(JRFillDataset.java:1042)
 at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(JRFillDataset.java:668)
 at net.sf.jasperreports.engine.fill.JRParameterDefaultValuesEvaluator.evaluateParameterDefaultValues(JRParameterDefaultValuesEvaluator.java:90)
 at com.jaspersoft.studio.utils.ExpressionUtil.initBuiltInParameters(ExpressionUtil.java:400)
 at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:386)
 at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Timestamp
 at Detalle32de32Ticket_1629928932256_389202.evaluate(Detalle32de32Ticket_1629928932256_389202:183)
 at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:302)
 ... 8 more

Cause

Customer may be missing some files (attached to the case) and/or may be following incorrect steps. 

Environment

Release : 17.3

Component : JASPERSOFT REPORTS FOR SERVICE MANAGEMENT

Resolution

After reviewing the steps outlined in the attached document, the issue was resolved. 

Attachments

Date Example_1632170710800.zip get_app
1632170703122__Using Date Parameters in Jasper Report (2).docx get_app