JasperReports子报表上的异常中断,但有时仅

时间:2018-11-12 23:21:50

标签: list jasper-reports subreport

我有一个包含详细信息,页脚,摘要和背景带的主报告。如果摘要区域(通常为第二页)延伸到报表为三页,则一切正常且看起来不错。但是,由于某种原因,如果摘要仅为一页,则摘要(第二页)的背景不会显示。

这是背景xml:

<background>
    <band height="740" splitType="Stretch">
        <image scaleImage="RetainShape" onErrorType="Blank">
            <reportElement isPrintRepeatedValues="false" x="10" y="10" width="1174" height="730" uuid="e3e48fc0-40e1-4c28-8b59-8d0dbad6266f"/>
            <imageExpression><![CDATA["\\\\SERVER\\Data\\Design Files\\SolidEdgeDrawings\\ERP Draft Images\\"+String.format("%05d",$F{drawingRevision}.getDrawingID())+$F{drawingRevision}.getRevisionID()+($V{PAGE_COUNT}>1 ? "p"+$V{PAGE_NUMBER} : "")+".jpg"]]></imageExpression>
        </image>
        <rectangle radius="5">
            <reportElement mode="Transparent" x="0" y="0" width="1184" height="740" uuid="d8a0802f-d0b4-47ab-b76f-4daefc92a0e0"/>
        </rectangle>
        <subreport>
            <reportElement x="917" y="630" width="267" height="110" uuid="1e62add7-ed82-478d-8102-49e107067ebb"/>
            <subreportParameter name="drawingRevision">
                <subreportParameterExpression><![CDATA[$F{drawingRevision}]]></subreportParameterExpression>
            </subreportParameter>
            <subreportExpression><![CDATA["static/engineering/drawings/subreports/DrawingTitleBlock.jasper"]]></subreportExpression>
        </subreport>
    </band>
</background>

报告已完成,但我在日志中确实看到此错误:

  

2018-11-12 15:46:32,499错误[绘图子报告#1] impl.Jdk14Logger   (Jdk14Logger.java:101)-填充2:异常   java.lang.InterruptedException:空           在java.lang.Object.wait(本机方法)〜[?:1.8.0_144]           在java.lang.Object.wait(Object.java:502)〜[?:1.8.0_144]           在net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.suspend(AbstractThreadSubreportRunner.java:185)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.FillerSubreportParent.suspendSubreportRunner(FillerSubreportParent.java:168)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.FillerSubreportParent.addPage(FillerSubreportParent.java:147)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.JRBaseFiller.addPageToParent(JRBaseFiller.java:1426)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.JRVerticalFiller.addPage(JRVerticalFiller.java:2184)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummaryNoLastFooterSamePage(JRVerticalFiller.java:1300)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:1189)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:160)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:615)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:822)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:61)   [jasperreports-6.7.0.jar:6.6.0]           在net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:221)   [jasperreports-6.7.0.jar:6.6.0]           在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)   [?:1.8.0_144]           在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)   [?:1.8.0_144]           在java.lang.Thread.run(Thread.java:748)[?:1.8.0_144]

如果我在背景区域中删除子报表,则背景的其余部分显示良好,因此很明显,问题与该子报表有关。但是,我无法弄清楚为什么有时有时效果很好(第一页总是很好),但并非总是如此。希望这是足够的信息,并且不会过载无关数据。让我知道您是否需要查看更多内容。

错误是什么意思,为什么背景摘要页面始终不显示?谢谢!

更新:

我已将问题缩小到子报表中的列表元素。如果删除列表元素,就没有问题。有时工作正常的原因是该列表在打印中存在条件,因此当它不打印时,一切都很好。关于列表为什么会导致此问题的任何想法,或者可以采取什么措施来解决它?

以下是列表的xml:

<componentElement>
    <reportElement x="0" y="11" width="81" height="9" uuid="04ef37bc-783c-42cd-9afe-713453c84634">
        <property name="net.sf.jasperreports.export.headertoolbar.table.name" value="Approvals"/>
    </reportElement>
    <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
        <datasetRun subDataset="DrawingApprovals" uuid="15782f6d-5533-44e6-98a4-2e868a6173a4">
            <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{drawingRevision}.getApprovals())]]></dataSourceExpression>
        </datasetRun>
        <jr:listContents height="9" width="81">
            <textField>
                <reportElement x="0" y="0" width="17" height="9" uuid="675784d9-550a-4368-a813-79f71d8a695c"/>
                <textElement textAlignment="Center">
                    <font size="7"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{revisionID}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="17" y="0" width="17" height="9" uuid="399c832b-0a8f-441e-a24d-d96d4c66334e"/>
                <textElement textAlignment="Center">
                    <font size="7"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{drafter}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="34" y="0" width="17" height="9" uuid="fffc0fed-0b4c-4371-91ea-d29b00c509e9"/>
                <textElement textAlignment="Center">
                    <font size="7"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{approver}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="51" y="0" width="30" height="9" uuid="e0e7a53d-8a93-4dd2-9f3e-27c49844cbd9"/>
                <textElement textAlignment="Center">
                    <font size="7"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{approvalDate}]]></textFieldExpression>
            </textField>
        </jr:listContents>
    </jr:list>
</componentElement>

0 个答案:

没有答案