我有一个包含子报表的报表模板;
在主报告中,我有一些参数也应该在子报告中可用。
主要报告参数定义如下:
<parameter name="PID" class="java.lang.Integer"/>
在子报告中,我定义了具有相同名称的相同参数:
<parameter name="PID" class="java.lang.Integer"/>
我为子报告提供了主报告的参数,如下所示:\
<subreport>
<reportElement x="0" y="0" width="555" height="50"/>
<parametersMapExpression>
new HashMap($P{REPORT_PARAMETERS_MAP})
</parametersMapExpression>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression class="java.lang.String"><![CDATA["subRPT.jasper"]]></subreportExpression>
</subreport>
但这抛出了这个:
SEVERE: null
net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Incompatible java.lang.Integer value assigned to parameter PID in the subRPT dataset.
at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:711)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:419)
at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:378)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2035)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:760)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:270)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:946)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:845)
at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)
at biorec.control.reporting$1.doInBackground(reporting.java:177)
问题是什么?
谢谢