Jump to content
We've recently updated our Privacy Statement, available here ×

Problem by using timestamp as parameter in my Jasper Server


florian.johannssen_1

Recommended Posts

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>[/code]

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

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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-Services-Guide.pdf

"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."

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...