sushobhan.b Posted January 3, 2020 Share Posted January 3, 2020 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 More sharing options...
zeldakr Posted February 5, 2020 Share Posted February 5, 2020 HIhave a look at this, there is note at bottom it may helphttps://community.jaspersoft.com/questions/1107291/traversing-json-output-rest-api-datasourceI am currenly also trying to get my report to work with dynamic URL Link to comment Share on other sites More sharing options...
fatandaz Posted May 23, 2021 Share Posted May 23, 2021 you can find the answer here https://community.jaspersoft.com/documentation/tibco-jaspersoft-studio-user-guide/v720/connecting-web-service-using-json-data-adapt-0 Link to comment Share on other sites More sharing options...
gustavofarias Posted December 31, 2022 Share Posted December 31, 2022 Amazing how such a basic thing like this has no official answer. Almost every API needs passing anonymous parameters separated by / Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now