main report contains table and subreport which has pie chart. The problem is that the subreport is empty. my question is How do I pass JRBeanCollectionDataSource From Main Report to Subreport and How does Subreport use JRBeanCollectionDataSource?
The main report
<parameter name="statisDatasource" class="java.util.Collection"/>
<subreport>
<reportElement x="164" y="206" width="200" height="100" />
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{statisDatasource})]]></dataSourceExpression>
<subreportExpression><![CDATA[this.getClass().getResourceAsStream($P{SUBREPORT_DIR} + "empTasks_subreport1.jasper")]]></subreportExpression>
</subreport>
the subreport
<field name="subjectName" class="java.lang.String"/>
<field name="marks" class="java.lang.Integer"/>
<detail>
<band height="125" splitType="Stretch">
<pie3DChart>
<chart>
<reportElement x="122" y="0" width="330" height="125" />
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<pieDataset>
<keyExpression><![CDATA[$F{subjectName}]]></keyExpression>
<valueExpression><![CDATA[$F{marks}]]></valueExpression>
</pieDataset>
<pie3DPlot>
<plot/>
<itemLabel/>
</pie3DPlot>
</pie3DChart>
</band>
</detail>