Howto submit a date-parameter to exec a report via Rest-v2?

Hi,

I want to execute a report by ReST-2 with a date as a mandatory parameter: 

 curl -u user:password http://jasper:8080/jasperserver/rest_v2/reports/testReport.csv?start_dat...

Returns

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><errors><error><defaultmessage>Geben Sie einen gültigen Wert für den Typ 'Date' an.</defaultmessage><errorcode>fillParameters.error.invalidValueForType</errorcode></error></errors>

 

What is the correct formating of the date for the GET-Parameter?

migmedia's picture
Joined: Oct 21 2012 - 9:59pm
Last seen: 8 years 2 months ago

2 Answers:

The date-format seems to depend on the server locale. For de_DE the date-parameter has to be 'dd.MM.yyyy' formated.

It's looks a bit strange, but it works for me.

migmedia's picture
Joined: Oct 21 2012 - 9:59pm
Last seen: 8 years 2 months ago

The format you are using should be correct for a regular date parameter, For example try this on the freight report (comes with the samples) as an example http://localhost:8080/jasperserver-pro/rest_v2/reports/reports/samples/F...

The problem may be that your parameter is defined as a date-time instead of a date.

marianol's picture
15784
Joined: Sep 13 2011 - 8:04am
Last seen: 4 years 5 months ago

Thanks for the hint.
But the date-format seems to depend on the server locale. For de_DE the date-parameter has to be 'dd.MM.yyyy' formated.

migmedia - 10 years 1 week ago
Feedback
randomness