how can I create report that will iterate over arraylist in detail section that is passed as parameter in Jasper report?
Is that even possible? I searched and I found soloution that you have to add ArrayList as datasource. How do I do that?
Regards
You can create an SubReport an pass the ArrayList as DataSourceExpression:
<subreport>
...
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{arrayList})]]></dataSourceExpression>
<subreportExpression><![CDATA["subreport.jasper"]]></subreportExpression>
</subreport>
Javadoc:
http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/data/JRBeanCollectionDataSource.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With