Error when running Jasper reports using input parameters
search cancel

Error when running Jasper reports using input parameters

book

Article ID: 382966

calendar_today

Updated On:

Products

CA Service Management - Service Desk Manager CA Service Desk Manager CA Service Catalog

Issue/Introduction

After upgrading from Jasper 7.9 to 9.0, reports with date input parameters fail with the following errors in the UI and jasperver.log:

net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Error executing SQL statement for:
...
net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:221) ... 3 more Caused by: java.sql.SQLException: com.ca.sdm.dal.sql.DALException: com.ca.sdm.dal.PersistenceException: com.ca.sdm.bop.BPMessagingException: com.ca.sdm.bop.BPMessagingException: Literal de fecha no vĂ¡lido N'null'. Debe tener el formato {d'aaaa-mm-dd hh:mm:ss xm'} at N'null' ... } 

and

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

Environment

Service Desk Manager 17.x

Jasper 7.9/9.0

Cause

Jasper accepts different formats for AM/PM in Jasper 9.0.

Jasper 7.9 reports are using the following format:

DATEFORMAT($P{dateparameter},"yyyy-MM-dd HH:MM:SS aa")

Resolution

In Jasper 9.0 reports, modify (via JasperStudio) the reports to use the following format for AM/PM:

DATEFORMAT($P{dateparameter},"yyyy-MM-dd HH:MM:SS AA")

or 

DATEFORMAT($P{fechaDesde},"dd-MM-yyyy hh:mm:ss a")