Using value of record in main report as parameter for datasource expression

Hi all, 

here is the background:

I have a report which has a table. The report makes a rest call using a documentID to get a json dataset with only the record for that document.

<parameter name="net.sf.jasperreports.json.source" class="java.lang.String" isForPrompting="false">
        <defaultValueExpression><![CDATA["http://IP/TableViewer?type=JSON" + "&modelId=" + $P{modelId} + "&documentId=" + $P{documentId} + "&docType=" + $P{docType}]]></defaultValueExpression>
    </parameter>

The table uses the same data and is set to perform the same datasource collection. thanks to : ((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource()

This works well.

Now, I want to put this report inside a main report.

I want the main report to get several records containing the documentIDs and pass thoses to the subreport in detail band. So that the subreports use this documentId in their rest call.

The idea is to have multiple time the same subreport but with different data.

I'm not sure this is possible.

I could have the main report get the records I want and pass them to the sub report in detail band, however, the subreport has a table that needs to use a datasource of its own.

Thanks in advance

 

pierre.ortalo's picture
Joined: Aug 16 2017 - 1:34am
Last seen: 5 years 3 weeks ago

0 Answers:

No answers yet
Feedback