hknakata Posted June 26, 2018 Share Posted June 26, 2018 How to set parameter in json datasource at jasper report server?I have a json url, https://jsonplaceholder.typicode.com/postswant to pass a parameter user id to filtering, https://jsonplaceholder.typicode.com/posts?userId=1 Link to comment Share on other sites More sharing options...
narcism Posted June 26, 2018 Share Posted June 26, 2018 Starting with Jaspersoft Studio 6.4.0 and JasperReports Server 6.4.0 you can set URL parameters in the JSON Data Adapter or by setting specific properties at the parameter level. More info in the HTTP Data Adapter Sample: http://jasperreports.sourceforge.net/sample.reference/httpdataadapter/index.html Link to comment Share on other sites More sharing options...
hknakata Posted June 27, 2018 Author Share Posted June 27, 2018 @narcism thank you for the prompt reply. I know how to set in data adapter via Jasper Studio. However, I don't know how to set in the server. When I create a "json datasource type" data source, it only has three options (url, langauge type, and query) and nothing about parameter. Link to comment Share on other sites More sharing options...
hknakata Posted June 29, 2018 Author Share Posted June 29, 2018 I found we cannot set in web admin console directly.However, we can deploy it after we set in Jaspersoft Studio.Here are some steps for reference.1.Create data adaptor, and set with URL parameter2. Edit source of report3. Replace following lines Old<property name="com.jaspersoft.studio.data.defaultdataadapter" value="myAdapter.xml"/>New<property name="net.sf.jasperreports.data.adapter" value="myAdapter.xml"/> 4. Deploy the report 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