主表jrxml是:
<?xml version="1.0" encoding="UTF-8"?>
<![CDATA["C:\Users\xp\Desktop\ireport\sjt\"]]>
<![CDATA[]]>
<![CDATA[annualBuild]]>
<![CDATA[annualBuildDetail]]>
<![CDATA[annualItem]]>
<![CDATA[annualUnit]]>
<![CDATA[reportName]]>
<![CDATA[class]]>
<![CDATA[2013年度全校能耗统计报表]]>
<![CDATA[net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{annualBuild})]]>
<![CDATA[$P{SUBREPORT_DIR} + "annual_energy_report_building.jasper"]]>
<![CDATA[net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{annualUnit})]]>
<![CDATA[$P{SUBREPORT_DIR} + "annual_energy_report_unit.jasper"]]>
<![CDATA[net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{annualItem})]]>
<![CDATA[$P{SUBREPORT_DIR} + "annual_energy_report_item.jasper"]]>
<![CDATA[net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{annualBuildDetail})]]>
<![CDATA[$P{SUBREPORT_DIR} + "annual_energy_report_buildDetail.jasper"]]>
编译通过,但是阅览时报错,如下:
Error filling print... Error evaluating expression : Source text : net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{annualBuild})
Setting up the file resolver... net.sf.jasperreports.engine.fill.JRExpressionEvalException: Error evaluating expression : Source text : net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{annualBuild}) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:203) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:591) at net.sf.jasperreports.engine.fill.JRCalculator.evaluate(JRCalculator.java:559) at net.sf.jasperreports.engine.fill.JRFillElement.evaluateExpression(JRFillElement.java:966) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:392) at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:294) at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:259) at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:455) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2044) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:778) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:288) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:151) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:909) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:841) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:88) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:653) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:569) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:915) at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:928) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572) at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997) Caused by: groovy.lang.MissingPropertyException: No such property: net for class: annual_energy_report_1372136929372_105017 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:50) at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:86) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231) at annual_energy_report_1372136929372_105017.evaluate(calculator_annual_energy_report_1372136929372_105017:173) at net.sf.jasperreports.engine.fill.JREvaluator.evaluate(JREvaluator.java:190) ... 20 more
Print not filled. Try to use an EmptyDataSource...