I made minor changes on the Java side.
Instead of passing a JRBeanCollectionDataSource:
parameters.put(FILTER_TABLE_DATA_SOURCE, new JRBeanCollectionDataSource(filterList));
I directly passed the list as a parameter
parameters.put(FILTER_TABLE_DATA_SOURCE, filterList);
Main report
Create the parameters as shown below.
<parameter name="FILTER_TABLE_DATA_SOURCE" class="java.util.List"/>
Select a sub-report in MasterReport and go to the "Subregister Properties" section and set the expression "Data Source" as follows: and it will set $ P {REPORT_DATA_SOURCE}
new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{FILTER_TABLE_DATA_SOURCE})
Sub report
First, I made a mistake by placing the table in the Summary group.
The table should always be in the Detailed range section.
because the fields inside the table must be iterated, which makes the data group.
create a table as usual with the fields that are in this list, but do not forget to use *$P{REPORT_DATA_SOURCE}* as a JRDatasource expression
source share