Today I had a problem. I had a complex bean (Bean which contained other beans) which was being sent as JRBeanCollectionDataSource (JasperReports API version 2.0.2) to a Jasper Report.
This report had to have sub reports for the inner bean. I really could not find out how to pass the bean to the subreport from my main report.
Finally I cracked the nut.
What I did was set the DataSourceExpression in the Subreport element to
<datasourceexpression>
<!–[CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{taxBeanList})]]–\>
</datasourceexpression>
Where $F{taxBeanList} is a collection of Tax Beans.
In My subreport I do not have any datasource or queires. This sort of got it working.
I hope to add more to this post in future when I reread it and find some gaps.
