Run report with different data set via REST API

0

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: 11 months 2 weeks ago

1 Answer:

1

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:

https://community.jaspersoft.com/documentation/tibco-jasperreports-server-administrator-guide/v71/attributes-data-source-definitions

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
4416
Joined: Mar 5 2012 - 9:19am
Last seen: 2 days 5 hours ago
Feedback
randomness