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>
and in subreport using data dapter property:
<property name="net.sf.jasperreports.data.adapter" value="repo:/PID/Remote_JSON_Data_Adapter"/
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
2 Answers:
Posted on February 5, 2020 at 5:06am
HI
have a look at this, there is note at bottom it may help
https://community.jaspersoft.com/questions/1107291/traversing-json-outpu...
I am currenly also trying to get my report to work with dynamic URL
Posted on May 23, 2021 at 5:13am
you can find the answer here https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-u...
Attachments:
Attachment | Size |
---|---|
![]() | 95.96 KB |
Amazing how such a basic thing like this has no official answer. Almost every API needs passing anonymous parameters separated by /