Run report with different data set via REST API

We have a basic report that we want to target against different data sets (basically different mongo databases) via rest API, but we are getting just generic error message so I am wondering what we are doing wrong incorrectly.

The request being made is - "http://localhost:8081/jasperserver/rest_v2/reports/reports/CustomersReport.pdf?REPORT_DATA_SOURCE=%2fdatasources%2fTestDb". The data source TestDb and report CustomersReport both do exist in the jasperserver UI. If I go to edit the report data source in the UI to the /datasources/TestDb the report runs successfully - providing the parameter REPORT_DATA_SOURCE seems to break it. Any help would be greatly appreciated.

joshua.turner's picture
Joined: Nov 28 2018 - 8:50am
Last seen: 4 years 9 months ago

1 Answer:

If you're running them as different users, or from different servers, or from different organizations, you can use a data source defined with an attribute:

I don't know if there's any way to just pass an attribute using REST, with the same user/org/server setup.

elizam's picture
Joined: Mar 5 2012 - 9:19am
Last seen: 3 years 1 month ago