How to pass query parameters to a remote XML data source


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:

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.


lpalum's picture
Joined: Oct 2 2013 - 10:44am
Last seen: 7 years 2 months ago

2 Answers:

For this you will need to use the xPath2 query executor. This 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.



marianol's picture
Joined: Sep 13 2011 - 8:04am
Last seen: 4 years 1 month ago


a similar thread you'll find here.


mariuss's picture
Joined: Aug 11 2013 - 2:33pm
Last seen: 8 years 10 months ago