Jasper报告抛出一个JRValidationException,如何处理呢?

时间:2019-05-22 07:35:16

标签: jasper-reports

我正在使用Jaspersoft Studio版本6.6.0

我们在报告中仅使用了3个区域:-标题,页面页眉和页面页脚

我尝试增加标题栏并在引发错误消息后调整结果部分:

JRValidationException: Report design not valid : 
     1. The title section, the page and column headers and footers and the margins do not fit the page height.

任何人都可以解释问题出在哪里吗?我绝对是JasperReports和iReport的新手。

附加代码

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report5" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryWithPageHeaderAndFooter="true" whenResourceMissingType="Empty" uuid="d9f89c50-9c34-4291-ae07-e0a341fe684b">
    <parameter name="reportTitle" class="java.lang.String"/>
    <parameter name="reportDate" class="java.lang.String"/>
    <parameter name="reportDateValue" class="java.lang.String"/>
    <parameter name="summaryLabel1" class="java.lang.String"/>
    <parameter name="label1" class="java.lang.String"/>
    <parameter name="labelValue1" class="java.lang.String"/>
    <parameter name="label2" class="java.lang.String"/>
    <parameter name="labelValue2" class="java.lang.String"/>
    <parameter name="label3" class="java.lang.String"/>
    <parameter name="labelValue3" class="java.lang.String"/>
    <parameter name="label4" class="java.lang.String"/>
    <parameter name="labelValue4" class="java.lang.String"/>
    <parameter name="label5" class="java.lang.String"/>
    <parameter name="labelValue5" class="java.lang.String"/>
    <parameter name="label6" class="java.lang.String"/>
    <parameter name="labelValue6" class="java.lang.String"/>
    <parameter name="label7" class="java.lang.String"/>
    <parameter name="labelValue7" class="java.lang.String"/>
    <parameter name="label8" class="java.lang.String"/>
    <parameter name="labelValue8" class="java.lang.String"/>
    <parameter name="label13" class="java.lang.String"/>
    <parameter name="labelValue13" class="java.lang.String"/>
    <parameter name="label14" class="java.lang.String"/>
    <parameter name="label16" class="java.lang.String"/>
    <parameter name="labelValue14" class="java.lang.String"/>
    <parameter name="labelValue15" class="java.lang.String"/>
    <parameter name="labelValue16" class="java.lang.String"/>
    <parameter name="image1" class="java.lang.String"/>
    <parameter name="image2" class="java.lang.String"/>
    <parameter name="image3" class="java.lang.String"/>
    <parameter name="label9" class="java.lang.String"/>
    <parameter name="label10" class="java.lang.String"/>
    <parameter name="label11" class="java.lang.String"/>
    <parameter name="label12" class="java.lang.String"/>
    <parameter name="labelValue9" class="java.lang.String"/>
    <parameter name="labelValue10" class="java.lang.String"/>
    <parameter name="labelValue11" class="java.lang.String"/>
    <parameter name="labelValue12" class="java.lang.String"/>
    <parameter name="resultSection" class="java.lang.String"/>
    <parameter name="imageName1" class="java.lang.String"/>
    <parameter name="imageName2" class="java.lang.String"/>
    <parameter name="summaryLabel2" class="java.lang.String"/>
    <title>
        <band height="900">
            <textField>
                <reportElement x="105" y="0" width="349" height="41" forecolor="#660000" uuid="dc7ab326-ab55-4f46-bb6b-0ab4d75ae3cd"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font fontName="SansSerif" size="16" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{reportTitle}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="291" y="81" width="87" height="20" uuid="be6a241f-d84a-48ca-bd6d-21558cb21f6c"/>
                <textElement>
                    <font isBold="false"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{reportDate}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="378" y="81" width="177" height="20" uuid="422d11e6-d721-41d5-b8ea-e1c8383baa80"/>
                <textFieldExpression><![CDATA[$P{reportDateValue}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="223" y="41" width="122" height="30" uuid="ce2dfe31-641c-4e05-bcb6-ff42a37854da"/>
                <textElement textAlignment="Left">
                    <font fontName="SansSerif" size="13" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{labelValue1}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="93" y="598" width="100" height="20" isRemoveLineWhenBlank="true" uuid="335f8f7f-67b0-47c3-a58e-d58249f2e196"/>
                <textFieldExpression><![CDATA[$P{label9}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="93" y="614" width="100" height="20" isRemoveLineWhenBlank="true" uuid="f9fa9f43-94a2-469c-9f19-8075d5549ba9"/>
                <textFieldExpression><![CDATA[$P{label10}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="93" y="634" width="100" height="20" isRemoveLineWhenBlank="true" uuid="3a477834-9f09-45f0-abc8-d51757ba472d"/>
                <textFieldExpression><![CDATA[$P{label11}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="93" y="654" width="100" height="20" isRemoveLineWhenBlank="true" uuid="9fe4bc7c-119e-4841-8ca9-e052bd8ad216"/>
                <textFieldExpression><![CDATA[$P{label12}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="271" y="594" width="224" height="20" isRemoveLineWhenBlank="true" uuid="e7683f01-1631-4cd1-b0a9-d8bf878df726"/>
                <textFieldExpression><![CDATA[$P{labelValue9}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="271" y="614" width="224" height="20" isRemoveLineWhenBlank="true" uuid="88edf1ae-8cb2-4f7c-9f4c-a435ae3dfa09"/>
                <textFieldExpression><![CDATA[$P{labelValue10}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="271" y="634" width="224" height="20" isRemoveLineWhenBlank="true" uuid="ad3a5b22-4e36-430b-be33-0c0d018e59ea"/>
                <textFieldExpression><![CDATA[$P{labelValue11}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="271" y="654" width="273" height="55" isRemoveLineWhenBlank="true" uuid="2c0cfd8d-e88e-4077-a48d-8cb3e6a547a4"/>
                <textFieldExpression><![CDATA[$P{labelValue12}]]></textFieldExpression>
            </textField>
            <line>
                <reportElement x="0" y="77" width="555" height="1" uuid="23897362-b65a-415c-89e4-6a3a96bcc11f"/>
            </line>
            <textField>
                <reportElement x="10" y="558" width="120" height="22" forecolor="#660000" uuid="5da2935c-1f58-4bf9-9b9d-84df7189b8fe"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="SansSerif" size="12" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{resultSection}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="10" y="584" width="120" height="35" isRemoveLineWhenBlank="true" forecolor="#000000" uuid="dc7ab326-ab55-4f46-bb6b-0ab4d75ae3cd"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="SansSerif" size="10" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{summaryLabel2}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="10" y="101" width="120" height="35" isRemoveLineWhenBlank="true" forecolor="#660000" uuid="c156c013-e0bc-4c71-8138-8e59f587dc9f"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="SansSerif" size="12" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{summaryLabel1}]]></textFieldExpression>
            </textField>
            <image>
                <reportElement stretchType="RelativeToBandHeight" x="10" y="610" width="519" height="240" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="225eb93d-c22f-43d7-9f6b-1a1644a0119e"/>
                <imageExpression><![CDATA[$P{image1}]]></imageExpression>
            </image>
            <image>
                <reportElement stretchType="RelativeToBandHeight" x="10" y="38" width="534" height="189" isRemoveLineWhenBlank="true" isPrintWhenDetailOverflows="true" uuid="46d8f1f9-8fca-48b4-ad4e-d8c47e3282a6"/>
                <imageExpression><![CDATA[$P{image2}]]></imageExpression>
            </image>
            <textField isBlankWhenNull="true">
                <reportElement x="10" y="580" width="183" height="24" isRemoveLineWhenBlank="true" uuid="0e0a9497-1c2c-472c-94aa-e1ccfaf22227"/>
                <textElement>
                    <font isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{imageName1}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="10" y="18" width="183" height="20" isRemoveLineWhenBlank="true" uuid="9cf432dc-c6c7-4654-838a-cd40bdd418d3"/>
                <textElement>
                    <font isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{imageName2}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="9" y="353" width="120" height="22" forecolor="#660000" uuid="e0609f44-c9e0-4fb9-ac40-c827a78b06b0"/>
                <textElement verticalAlignment="Middle">
                    <font fontName="SansSerif" size="12" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{resultSection}]]></textFieldExpression>
            </textField>
        </band>
    </title>
    <pageHeader>
        <band height="50">
            <textField isBlankWhenNull="true">
                <reportElement x="150" y="2" width="100" height="20" uuid="b2757f57-503c-46dc-80e3-9a89e39ddf05">
                    <printWhenExpression><![CDATA[$V{PAGE_NUMBER} > 1]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font fontName="Calibri Light" size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{label1}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement mode="Transparent" x="371" y="2" width="100" height="20" forecolor="#000000" backcolor="#FFFFFF" uuid="89d6a74b-9243-4a8b-a72e-136681f7fd79">
                    <printWhenExpression><![CDATA[$V{PAGE_NUMBER} > 1]]></printWhenExpression>
                </reportElement>
                <textElement>
                    <font fontName="Calibri Light" size="8"/>
                </textElement>
                <textFieldExpression><![CDATA[$P{labelValue1}]]></textFieldExpression>
            </textField>
        </band>
    </pageHeader>
    <pageFooter>
        <band height="50">
            <textField>
                <reportElement x="211" y="1" width="80" height="20" uuid="5f36a284-1506-4b18-9f9b-c01cf105df12"/>
                <textElement textAlignment="Right">
                    <font fontName="Calibri Light"/>
                </textElement>
                <textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
            </textField>
            <textField evaluationTime="Report">
                <reportElement x="291" y="1" width="40" height="20" uuid="6fc0add2-aa14-4039-ab1a-be47ac381100"/>
                <textElement>
                    <font fontName="Calibri Light"/>
                </textElement>
                <textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
            </textField>
        </band>
    </pageFooter>
</jasperReport>

以下是日志中显示的错误:

com.lifetech.converge.plugins.service.impl.AnalysisReportServiceImpl  - Report design not valid : 
     1. The title section, the page and column headers and footers and the margins do not fit the page height.
     2. The 'report5_7313_global_column_0' group header section, the title, the page and column headers and footers and the margins do not fit the first page height.
     3. The 'report5_7313_global_column_0' group footer section, the title, the page and column headers and footers and the margins do not fit the first page height.
     4. The 'report5_7313_global_column_1' group header section, the title, the page and column headers and footers and the margins do not fit the first page height.
     5. The 'report5_7313_global_column_1' group footer section, the title, the page and column headers and footers and the margins do not fit the first page height.
     6. The 'report5_7313_global_column_2' group header section, the title, the page and column headers and footers and the margins do not fit the first page height.
     7. The 'report5_7313_global_column_2' group footer section, the title, the page and column headers and footers and the margins do not fit the first page height.
net.sf.jasperreports.engine.design.JRValidationException: Report design not valid : 
     1. The title section, the page and column headers and footers and the margins do not fit the page height.
     2. The 'report5_7313_global_column_0' group header section, the title, the page and column headers and footers and the margins do not fit the first page height.
     3. The 'report5_7313_global_column_0' group footer section, the title, the page and column headers and footers and the margins do not fit the first page height.
     4. The 'report5_7313_global_column_1' group header section, the title, the page and column headers and footers and the margins do not fit the first page height.
     5. The 'report5_7313_global_column_1' group footer section, the title, the page and column headers and footers and the margins do not fit the first page height.
     6. The 'report5_7313_global_column_2' group header section, the title, the page and column headers and footers and the margins do not fit the first page height.
     7. The 'report5_7313_global_column_2' group footer section, the title, the page and column headers and footers and the margins do not fit the first page height.
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.verifyDesign(JRAbstractCompiler.java:271) ~[jasperreports-5.6.1.jar:5.6.1]
    at net.sf.jasperreports.engine.design.JRAbstractCompiler.compileReport(JRAbstractCompiler.java:153) ~[jasperreports-5.6.1.jar:5.6.1]

0 个答案:

没有答案