I\'m working on a struts
based application. I want to create a Jasper report containing questions and responses for a Paper
Object. Clearl
PerFect............ In addition Please import classes in your main report
<import value="net.sf.jasperreports.engine.*"/>
<import value="net.sf.jasperreports.engine.data.*"/>
and subreport tag would have
<subreport isUsingCache="true">
<reportElement x="0" y="39" width="555" height="276"/>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{addresses})]]></dataSourceExpression>
<subreportExpression class="java.lang.String"><![CDATA[$P{SUBREPORT_DIR} + "report1_subreport5.jasper"]]></subreportExpression>
</subreport>
And subreport would just look like normal fields. note: subreport will not comiple and would give error that it is not able find the field in the bean.
new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{questions})