How to pass a List of Objects to a subreport and directly use that Object as a field in JasperReport?

Viewed 1926

On my master report, I have a parameter ArrayList<Customer> ($P{customers}) and I want to pass that List to a subreport. For now, I am using the following data source expression:

new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{customers})

However on the subreport, I want to directly use the Customer objects of that List as a field, so I just have a single field $F{customer} (Field Class: Customer).

How can I achieve that?

0 Answers
Related