creating subreport with iReport tool for JasperReports

前端 未结 2 1863
滥情空心
滥情空心 2020-12-22 06:23

I\'m working on a struts based application. I want to create a Jasper report containing questions and responses for a Paper Object. Clearl

相关标签:
2条回答
  • 2020-12-22 06:46

    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.

    0 讨论(0)
  • 2020-12-22 06:57

    new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{questions})

    0 讨论(0)
提交回复
热议问题