[#13676] - Datetimevalidator uses wrong Format

Bug report
Project: Severity:
Component: Reproducibility:
Assigned to:

I upgraded form v7.2 to v7.8.

All Reports with java.sql.timestamp in parameters stopped working

The server uses german local and displays all values as configured in jasperserver/WEB-INF/bundles/jasperserver_config_de.properties

After changing the value of timestamp parameter there is an invalid value error message and all depending input controls lose there values.

I found out that the expression for validating the paramter is wrong:

ateTimeFormatValidationRule: {errorMessage: "Geben Sie einen gültigen Datums-/Uhrzeitwert an.", format: "yyyy-MM-dd'T'HH:mm:ss"}
errorMessage: "Geben Sie einen gültigen Datums-/Uhrzeitwert an."
format: "yyyy-MM-dd'T'HH:mm:ss"

After that i did some research in source code and found out that these values are hardcodes in file:
package com.jaspersoft.jasperserver.inputcontrols.util;

import com.jaspersoft.jasperserver.inputcontrols.util.DefaultCalendarFormatProvider;

* <p></p>
* @author yaroslav.kovalchyk
* @version $Id$
public class IsoCalendarFormatProvider extends DefaultCalendarFormatProvider {
protected String getDatetimeFormatPattern() {
return "yyyy-MM-dd'T'HH:mm:ss";

protected String getTimeFormatPattern() {
return "HH:mm:ss";

protected String getDateFormatPattern() {
return "yyyy-MM-dd";

So there is no chance for the validator to check if the value looks like configured.

Input Controls
christian.philipp's picture
Joined: Apr 15 2014 - 7:43am
Last seen: 2 months 1 week ago



Have you installed sample data? Can you provide step to reproduce this issue? However, I know com.jaspersoft.jasperserver.inputcontrols.util.DefaultCalendarFormatProvider supports locale. Btw, if you want, you can change isoCalendarFormatProvider bean to point to other class in applicationContext.xml.


And there is also com.jaspersoft.jasperserver.inputcontrols.util.MessagesCalendarFormatProvider which uses the same interface, so you can configure bean to use it instead. And ISO calendar is supposed to be a fixed format. Thanks.


No i have not installed sample data. I had a look at the sample reports but they have no parameters and are very simple.

I have downloaded the current configuration from our old Jasperserver version 7.2 and imported it to the new 7.8 version.

Setps the reproduce are very easy.

on jasperserver 7.2

create a datetime datatype

create a inputcontorl using this datatype

add a report which is using this datatype.

Export the configuration form jasperserver 7.2.

I installed jasperserver 7.8 with default options and without sample data.


restart services

A report running on jasperserver 7.2 is now causing an errormessage for datetimeinput on first change of the paramter.
The report can be executed but all depended parameters have an error on first change of the datetimeparameter.


could you please provide detailed information how to change the configurtion to get it working?
what should i change in which line of which file.


I finally found a easy way to reproduce the error on a new bank system

1. I created a report called test with following content and published it to jasperserver 7.8:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.9.0.final using JasperReports Library version 6.9.0-cb8f9004be492ccc537180b49c026951f4220bf3 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d5594521-0fa8-49a9-acf3-785d578e3857">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<property name="ireport.jasperserver.url" value=""/>
<property name="ireport.jasperserver.user" value="jasperadmin"/>
<property name="ireport.jasperserver.report.resource" value="/Reports/test_files/main_jrxml"/>
<property name="ireport.jasperserver.reportUnit" value="/Reports/test"/>
<parameter name="startdatetime" class="java.sql.Timestamp">
<parameter name="enddatetime" class="java.sql.Timestamp">
<parameter name="sadfg" class="java.lang.String"/>
<band splitType="Stretch"/>
<band height="83" splitType="Stretch">
<reportElement x="50" y="30" width="100" height="30" uuid="18626603-af7d-4a47-98de-c6f28c2e0e7b"/>
<reportElement x="210" y="20" width="100" height="30" uuid="0c5d4a61-fcfc-4cfc-9cfd-d63e0237a097"/>
<band height="35" splitType="Stretch"/>
<band height="61" splitType="Stretch"/>
<band height="125" splitType="Stretch"/>
<band height="45" splitType="Stretch"/>
<band height="54" splitType="Stretch"/>
<band height="42" splitType="Stretch"/>

2. i created a new parameter on server which uses the 2 parameters from the report in it sql and added it to the report without using it anywhere in the reportfile.

The query of the new parameter is:

comp_shop.id as shopid,
comp_shop.nr as shopnr,
crm_address.city as city
join crm_address on comp_shop.address_id=crm_address.id
join comp_shop_region as shopregion on shopregion.shop_id=comp_shop.id
join comp_region as region on shopregion.region_id=region.id and region.parent_region_id is not null
join comp_region as area on region.parent_region_id=area.id
$P{startdatetime}<ISNULL(comp_shop.close_date,'01.01.2100') and
order by

when i add the depending parameter the error is shown and when i remove it the error is gone.


if you remove the following line, will it work?

Is it because the day constant not in ISO format?


enddatetime And startdatetime seems to be timestamp. Is comp_shop.open_date column also timestamp or just date?


after removing the line error is still the same on enddatetime parameter.
startdatetime is now working because it is missing in the depended parameter
the constant is working on jaspserver 7.2 with german sql server version


startdatetime and enddatetime are timestamp
open and close date are just date

Create Statement for comp_shop table:

create table comp_shop
id bigint NOT NULL,
nr int NOT NULL,
name varchar(255) NULL,
address_id bigint NOT NULL,
open_date DATE NULL,
close_date Date NULL,
manager_id bigint NULL,
company_id bigint NOT NULL,
rangeidentifier_invoicenumber int NULL,


when will the bug be fixed?


Error still exists in 8.0.1