Problem by using timestamp as parameter in my Jasper Server

0

Hi Jasper fans,

on my jasperserver, i have a report with two timestamp parameters (StartDate, EndDate). If i want to pass the date via the restv2 interface, i receive the following error:

<errorCode>input.controls.validation.error</errorCode>
<message>Input controls validation failure</message>

Specify a valid value for type Timestamp.

The value of the timestamp parameter is just a typically sql.timestamp like: 2018-06-01 19:52:34.266

My GET-Request is like: HOST:8080/jasperserver/rest_v2/reports/myReport.pdf?StartDate=2018-06-01 19:52:34.266

I don´t know why the server rest interface throws a validation error. Does anyone have a suggestion or idea to solve this problem? Thank you very much.

Kind Regards Florian

florian.johannssen_1's picture
Joined: Sep 1 2017 - 3:33am
Last seen: 12 months 4 days ago

2 Answers:

0

Check the web services guide, it looks like it needs a timezone too. 

https://docs.tibco.com/pub/js-jrs/6.1.2/doc/pdf/JasperReports-Server-Web...

"Both date-only and timestamp fields are given in the ISO date-time format such as 1997-01- 01T04:05:06+02:00. For database columns that store a time and date that includes a time zone, such as “timestamp with time zone” in PostgreSQL, the result is not guaranteed to be in the same timezone as stored in the database. These dates and times are converted to the server’s time zone."

reportdev's picture
1222
Joined: Oct 12 2015 - 12:05pm
Last seen: 3 months 5 days ago
0

Hi reportdev,

when I follow your advice, i dont get this error. Great.

But, i did the following. I have a report with two Parameter-Dates: StartDate and EndDate (java.util.Date in the jasper studio)

When I call the jasper server with: StartDate=1997-01-01T04:05:06+02:00 , the report will display: StartDate : 1997-01-01 00:00:00. So the time information is lost.

If i set the ParameterType to java.sql.Timestamp, it works....but i have to use the java.util.date on the report-side.

Any Advice?

Many thanks and kind regards

Florian

florian.johannssen_1's picture
Joined: Sep 1 2017 - 3:33am
Last seen: 12 months 4 days ago
Feedback