I am new to jaspersoft. I am looking for a tutorial and/or explaination on how to specify query parameters for a remote XML data source.
We have a RESTful api that returns XML records and I would like to have the user of a report that pulls from the remote XML data source (our api) be able to specify a set of query parameters.
E.g. the call to the API might look like this: https://api.mydomain.com/api/records
and the query parameters might specify a userId and time range for records where the resulting GET request to the api would be:
I am developing the report in iReport Designer Pro version 5.2.0 and deploying to jasperserver-pro in AWS.
Any insight is appreciated. Thanks.
For this you will need to use the xPath2 query executor. This http://community.jaspersoft.com/wiki/remote-xml-datasource is a really godd example of the use of remote XML datasources in Jasper
The full sample does reporting based on the Twitter open API has parameters that are passed to the API call to select the twitter account and the amount of tweets you want to retrieve, similar to your needs.
A couple of considerations: this sample it was made for JRS 4.7 but works with 5.2 and AWS without issues. The only problem is that since then Twitter has deprecated the 1.0 version of their API and they no longer provide XML data in their API so you will not be able to run the report as is. But it will be easy enough to change it to use your own API.