Jump to content
Changes to the Jaspersoft community edition download ×

How to pass dynamic parameter value to data adapter URL in jasper


sushobhan.b

Recommended Posts

Hi All,

I have a subreport which is populating data using json url.

for json URL i am using a data adapter and subreport is also sing same.

Below is my data adaapter file.

<?xml version="1.0" encoding="UTF-8" ?><jsonDataAdapter class="net.sf.jasperreports.data.json.JsonDataAdapterImpl">    <name>Remote_JSON_Data_Adapter </name>    <dataFile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"              xsi:type="httpDataLocation">        <method>GET</method>        <url>http://xxx.com/api/v1/pricelists/</url>        <username>techUser</username>        <password>mDNWqaff7sRmbwqQ8m</password>    </dataFile>    <language>json</language>    <useConnection>true</useConnection>    <timeZone xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"              xmlns:java="http://java.sun.com"              xsi:type="java:java.lang.String">        Asia/Calcutta    </timeZone>    <locale xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"            xmlns:java="http://java.sun.com"            xsi:type="java:java.lang.String">        en_IN    </locale>    <selectExpression></selectExpression></jsonDataAdapter>[/code]

and in subreport using data dapter property:

<property name="net.sf.jasperreports.data.adapter"           value="repo:/PID/Remote_JSON_Data_Adapter"/[/code]

My question is.

how i can pass a ID to data adapter from subreport like below: 

so that url can be formed like : http://xxx.com/api/v1/pricelists/{ID}.

Please help

Link to comment
Share on other sites

  • 1 month later...
  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 year later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...