Hi all,
I've been strruggling a while with this now. I have a main report with a parameter that I need to use in the subreport datasource expression. I need it to be a json datasource.
I can't find a way to do this.
Thanks in advance :)
2 Answers:
Posted on November 29, 2017 at 12:24am
Got it :)
I used the following datasSource expression for the subreports:
new net.sf.jasperreports.engine.data.JsonDataSource("http://34....Id=" + $P{Id}.toString(), "")
It creates a JSONDatasource object by calling its constructor and passes the url where to get the json (location argument of the constructor) , second argument is a query on returned data. A main report argument can be passed to the url as you can see.
Hope it helps anyone :)
Please post some sample JRXML files for us to work with.
please post source code, s that we can use also.