Jasper子报告未显示

时间:2015-11-24 12:50:31

标签: jasper-reports

我有一份主要报告 每次调用2个不同的子报告,两次,每次都有不同的参数

问题是显示未正确显示。 LETTEROFACK_TRANSF_LTR,根本不会出现

<jasperReport name="LETTEROFACK" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="612" pageHeight="792" columnWidth="484" columnSpacing="0" leftMargin="64" rightMargin="64" topMargin="20" bottomMargin="0" whenNoDataType="NoPages" isTitleNewPage="false"          isSummaryNewPage="true">

    <queryString><![CDATA[......]]></queryString>

    <field name="GRP_ID" class="java.lang.String"/>
    <field name="DATE_VALUE" class="java.lang.String"/>
    <field name="PERSON_ID_AT" class="java.lang.String"/>
    <field name="PERSON_ID_AF" class="java.lang.String"/>
    <field name="AT_PRIM_SALUTATION" class="java.lang.String"/>
    <field name="AT_HF_GREETING" class="java.lang.String"/>
    <field name="AT_FIRST_NAME" class="java.lang.String"/>
    <field name="AT_MIDDLE_NAME" class="java.lang.String"/>
    <field name="AT_LAST_NAME" class="java.lang.String"/>
    <field name="AT_PRIMARY_ORG" class="java.lang.String"/>
    <field name="AT_ADDRESS1" class="java.lang.String"/>
    <field name="AF_PRIM_SALUTATION" class="java.lang.String"/>
    <field name="AF_HF_GREETING" class="java.lang.String"/>
    <field name="AF_FIRST_NAME" class="java.lang.String"/>
    <field name="AF_MIDDLE_NAME" class="java.lang.String"/>
    <field name="AF_LAST_NAME" class="java.lang.String"/>
    <field name="AF_PRIMARY_ORG" class="java.lang.String"/>
    <field name="AF_ADDRESS1" class="java.lang.String"/>
    <field name="AF_PRIMARY_LOGIN" class="java.lang.String"/>
    <field name="AT_NOMINEE_NAME" class="java.lang.String"/>
    <field name="AF_NOMINEE_NAME" class="java.lang.String"/>
    <field name="FUND_NAME" class="java.lang.String"/>
    <field name="TRANSFER_AMT" class="java.lang.String"/>
    <field name="TRANSFER_DATE" class="java.lang.String"/>
    <field name="TRANSFER_DATE1" class="java.lang.String"/>
        <detail>
            <band height="630"  isSplitAllowed="true" >
                <break>
                    <reportElement
                        x="0"
                        y="129"
                        width="484"
                        height="0"
                        key="element-1"/>
                </break>
                <subreport  isUsingCache="true">
                    <reportElement
                        x="10"
                        y="156"
                        width="199"
                        height="77"
                        key="subreport-2"
                        isRemoveLineWhenBlank="true"/>
                    <subreportParameter  name="FUND_NAME">
                        <subreportParameterExpression><![CDATA[$F{FUND_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="TRANSFER_DATE">
                        <subreportParameterExpression><![CDATA[$F{TRANSFER_DATE1}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="REPORT_BASE_DIR">
                        <subreportParameterExpression><![CDATA[$P{REPORT_BASE_DIR}]]></subreportParameterExpression>
                    </subreportParameter>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression  class="java.lang.String"><![CDATA[$P{REPORT_BASE_DIR}+"LETTEROFACK_SUB.jasper"]]></subreportExpression>
                </subreport>
                <break>
                    <reportElement
                        x="0"
                        y="280"
                        width="484"
                        height="0"
                        key="element-2"/>
                </break>
                <break>
                    <reportElement
                        x="0"
                        y="452"
                        width="484"
                        height="0"
                        key="element-3"/>
                </break>
                <subreport  isUsingCache="true">
                    <reportElement
                        x="12"
                        y="478"
                        width="199"
                        height="73"
                        key="subreport-4"
                        isRemoveLineWhenBlank="true"/>
                    <subreportParameter  name="FUND_NAME">
                        <subreportParameterExpression><![CDATA[$F{FUND_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="TRANSFER_DATE">
                        <subreportParameterExpression><![CDATA[$F{TRANSFER_DATE1}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="REPORT_BASE_DIR">
                        <subreportParameterExpression><![CDATA[$P{REPORT_BASE_DIR}]]></subreportParameterExpression>
                    </subreportParameter>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression  class="java.lang.String"><![CDATA[$P{REPORT_BASE_DIR}+"LETTEROFACK_SUB.jasper"]]></subreportExpression>
                </subreport>
                <subreport  isUsingCache="true">
                    <reportElement
                        x="10"
                        y="14"
                        width="199"
                        height="71"
                        key="subreport-1"
                        isRemoveLineWhenBlank="true"/>
                    <subreportParameter  name="DATE_VALUE">
                        <subreportParameterExpression><![CDATA[$F{DATE_VALUE}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="PRIM_SALUTATION">
                        <subreportParameterExpression><![CDATA[$F{AF_PRIM_SALUTATION}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="HF_GREETING">
                        <subreportParameterExpression><![CDATA[$F{AF_HF_GREETING}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="FIRST_NAME">
                        <subreportParameterExpression><![CDATA[$F{AF_FIRST_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="MIDDLE_NAME">
                        <subreportParameterExpression><![CDATA[$F{AF_MIDDLE_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="LAST_NAME">
                        <subreportParameterExpression><![CDATA[$F{AF_LAST_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="PRIMARY_ORG">
                        <subreportParameterExpression><![CDATA[$F{AF_PRIMARY_ORG}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="ADDRESS1">
                        <subreportParameterExpression><![CDATA[$F{AF_ADDRESS1}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="NOMINEE_NAME">
                        <subreportParameterExpression><![CDATA[$F{AF_NOMINEE_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="TRANSFERRED_FROM">
                        <subreportParameterExpression><![CDATA[$F{AT_FIRST_NAME}+($F{AT_MIDDLE_NAME} != null ? " "+$F{AT_MIDDLE_NAME}:"")+" "+$F{AT_LAST_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="TRANSFERRED_TO">
                        <subreportParameterExpression><![CDATA[$F{AF_FIRST_NAME}+($F{AF_MIDDLE_NAME} != null ? " "+$F{AF_MIDDLE_NAME}:"")+" "+$F{AF_LAST_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="FUND_NAME">
                        <subreportParameterExpression><![CDATA[$F{FUND_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="TRANSFER_AMT">
                        <subreportParameterExpression><![CDATA[$F{TRANSFER_AMT}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="REPORT_BASE_DIR">
                        <subreportParameterExpression><![CDATA[$P{REPORT_BASE_DIR}]]></subreportParameterExpression>
                    </subreportParameter>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression  class="java.lang.String"><![CDATA[$P{REPORT_BASE_DIR}+"LETTEROFACK_TRANSF_LTR.jasper"]]></subreportExpression>
                </subreport>
                <subreport  isUsingCache="true">
                    <reportElement
                        x="11"
                        y="311"
                        width="199"
                        height="104"
                        key="subreport-3"
                        isRemoveLineWhenBlank="true"/>
                    <subreportParameter  name="DATE_VALUE">
                        <subreportParameterExpression><![CDATA[$F{DATE_VALUE}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="PRIM_SALUTATION">
                        <subreportParameterExpression><![CDATA[$F{AT_PRIM_SALUTATION}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="HF_GREETING">
                        <subreportParameterExpression><![CDATA[$F{AT_HF_GREETING}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="FIRST_NAME">
                        <subreportParameterExpression><![CDATA[$F{AT_FIRST_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="MIDDLE_NAME">
                        <subreportParameterExpression><![CDATA[$F{AT_MIDDLE_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="LAST_NAME">
                        <subreportParameterExpression><![CDATA[$F{AT_LAST_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="PRIMARY_ORG">
                        <subreportParameterExpression><![CDATA[$F{AT_PRIMARY_ORG}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="ADDRESS1">
                        <subreportParameterExpression><![CDATA[$F{AT_ADDRESS1}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="NOMINEE_NAME">
                        <subreportParameterExpression><![CDATA[$F{AT_NOMINEE_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="TRANSFERRED_FROM">
                        <subreportParameterExpression><![CDATA[$F{AF_FIRST_NAME}+($F{AF_MIDDLE_NAME} != null ? " "+$F{AF_MIDDLE_NAME}:"")+" "+$F{AF_LAST_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="TRANSFERRED_TO">
                        <subreportParameterExpression><![CDATA[$F{AT_FIRST_NAME}+($F{AT_MIDDLE_NAME} != null ? " "+$F{AT_MIDDLE_NAME}:"")+" "+$F{AT_LAST_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="FUND_NAME">
                        <subreportParameterExpression><![CDATA[$F{FUND_NAME}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="TRANSFER_AMT">
                        <subreportParameterExpression><![CDATA[$F{TRANSFER_AMT}]]></subreportParameterExpression>
                    </subreportParameter>
                    <subreportParameter  name="REPORT_BASE_DIR">
                        <subreportParameterExpression><![CDATA[$P{REPORT_BASE_DIR}]]></subreportParameterExpression>
                    </subreportParameter>
                    <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    <subreportExpression  class="java.lang.String"><![CDATA[$P{REPORT_BASE_DIR}+"LETTEROFACK_TRANSF_LTR.jasper"]]></subreportExpression>
                </subreport>
            </band>
        </detail>
</jasperReport>

一个子报告(未显示的报告)

<jasperReport name="" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="612" pageHeight="792" columnWidth="484" columnSpacing="0" leftMargin="64" rightMargin="64" topMargin="20" bottomMargin="0" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false">
    <parameter name="REPORT_BASE_DIR" isForPrompting="true" class="java.lang.String"/>
    <parameter name="DATE_VALUE" isForPrompting="true" class="java.lang.String"/>
    <parameter name="PRIM_SALUTATION" isForPrompting="true" class="java.lang.String"/>
    <parameter name="HF_GREETING" isForPrompting="true" class="java.lang.String"/>
    <parameter name="FIRST_NAME" isForPrompting="true" class="java.lang.String"/>
    <parameter name="MIDDLE_NAME" isForPrompting="true" class="java.lang.String"/>
    <parameter name="LAST_NAME" isForPrompting="true" class="java.lang.String"/>
    <parameter name="PRIMARY_ORG" isForPrompting="true" class="java.lang.String"/>
    <parameter name="ADDRESS1" isForPrompting="true" class="java.lang.String"/>
    <parameter name="ADDRESS2" isForPrompting="true" class="java.lang.String"/>
    <parameter name="ADDRESS3" isForPrompting="true" class="java.lang.String"/>
    <parameter name="ADDRESS4" isForPrompting="true" class="java.lang.String"/>
    <parameter name="CITY" isForPrompting="true" class="java.lang.String"/>
    <parameter name="STATE" isForPrompting="true" class="java.lang.String"/>
    <parameter name="ZIP_CODE" isForPrompting="true" class="java.lang.String"/>
    <parameter name="CITY_STATE_ZIPCODE" isForPrompting="true" class="java.lang.String"/>
    <parameter name="NOMINEE_NAME" isForPrompting="true" class="java.lang.String"/>
    <parameter name="TRANSFERRED_FROM" isForPrompting="true" class="java.lang.String"/>
    <parameter name="TRANSFERRED_TO" isForPrompting="true" class="java.lang.String"/>
    <parameter name="FUND_NAME" isForPrompting="true" class="java.lang.String"/>
    <parameter name="TRANSFER_AMT" isForPrompting="true" class="java.lang.String"/>

        <background>
            <band height="0"  isSplitAllowed="true" >
            </band>
        </background>
        <title>
            <band height="0"  isSplitAllowed="true" >
            </band>
        </title>
        <pageHeader>
            <band height="96"  isSplitAllowed="true" >
                <printWhenExpression><![CDATA[new Boolean($V{PAGE_NUMBER}.intValue()%2==1)]]></printWhenExpression>
            </band>
        </pageHeader>
        <columnHeader>
            <band height="0"  isSplitAllowed="true" >
            </band>
        </columnHeader>
        <detail>
            <band height="630"  isSplitAllowed="true" >
                <textField isStretchWithOverflow="false" pattern="MMMMM dd, yyyy" isBlankWhenNull="true" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="53"
                        width="168"
                        height="14"
                        forecolor="#000000"
                        backcolor="#FFFFFF"
                        key="Date-1"/>
                    <box>                   <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                    <bottomPen lineWidth="0.0" lineColor="#000000"/>
                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
                    <textElement textAlignment="Left" verticalAlignment="Middle">
                        <font fontName="BentonSans Book" pdfFontName="font.otf" size="10" isBold="false" isPdfEmbedded ="true"/>
                    </textElement>
                <textFieldExpression   class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="83"
                        width="483"
                        height="14"
                        key="Salutation1-1"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[($P{PRIM_SALUTATION} != null ? $P{PRIM_SALUTATION}.concat($P{PRIM_SALUTATION}.lastIndexOf('.') != -1 ? " " : ". ") : "")+$P{FIRST_NAME}+($P{MIDDLE_NAME} != null ? " "+$P{MIDDLE_NAME}:"")+" "+$P{LAST_NAME}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="97"
                        width="294"
                        height="14"
                        key="textField-1"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{PRIMARY_ORG}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="111"
                        width="294"
                        height="14"
                        key="Add1-1"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{ADDRESS1} == null ? "" : $P{ADDRESS1}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="125"
                        width="294"
                        height="14"
                        key="Add2-1"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{ADDRESS2} == null ? "" : $P{ADDRESS2}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="139"
                        width="294"
                        height="14"
                        key="Add3-1"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{ADDRESS3} == null ? "" : $P{ADDRESS3}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="153"
                        width="294"
                        height="14"
                        key="Add4-1"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{ADDRESS4} == null ? "" : $P{ADDRESS4}]]></textFieldExpression>
                </textField>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="225"
                        width="462"
                        height="14"
                        key="Greeting-1"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA["Dear "+($P{HF_GREETING}.equalsIgnoreCase( "null" )?($P{FIRST_NAME}.equalsIgnoreCase( "null" )?"":$P{FIRST_NAME}):$P{HF_GREETING})+":"]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        x="0"
                        y="424"
                        width="90"
                        height="14"
                        key="staticText-2"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Sincerely,]]></text>
                </staticText>

                <staticText>
                    <reportElement
                        x="0"
                        y="474"
                        width="110"
                        height="14"
                        key="staticText-4"/>
                    <box></box>
                    <textElement verticalAlignment="Middle">
                        <font .../>
                    </textElement>
                <text><![CDATA[Name]]></text>
                </staticText>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="167"
                        width="294"
                        height="14"
                        key="Add4-2"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[($P{CITY} == null ? "" : $P{CITY}+ ", ").concat($P{STATE} == null ? "" : $P{STATE}+" ").concat($P{ZIP_CODE} == null ? "" : $P{ZIP_CODE})]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        x="5"
                        y="181"
                        width="42"
                        height="15"
                        key="staticText-15"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="4"
                        y="210"
                        width="42"
                        height="15"
                        key="staticText-16"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="4"
                        y="239"
                        width="42"
                        height="10"
                        key="staticText-17"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="4"
                        y="409"
                        width="42"
                        height="15"
                        key="staticText-20"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="4"
                        y="67"
                        width="42"
                        height="15"
                        key="staticText-21"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="0"
                        y="372"
                        width="475"
                        height="50"
                        key="textField-9"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement verticalAlignment="Top">
                        <font .../>
                    </textElement>
                <text><![CDATA[text text text]]></text>
                </staticText>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="0"
                        y="196"
                        width="483"
                        height="14"
                        key="Add1-2"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA["Account Name: "+$P{NOMINEE_NAME}]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        x="0"
                        y="248"
                        width="483"
                        height="14"
                        key="Add1-3"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[We confirm the following:]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="0"
                        y="261"
                        width="483"
                        height="14"
                        key="Add1-4"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Transferred From :]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="0"
                        y="315"
                        width="482"
                        height="14"
                        key="Add1-5"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Transferred To  :]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="55"
                        y="274"
                        width="89"
                        height="14"
                        key="Add1-6"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Registered Holder]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="55"
                        y="287"
                        width="89"
                        height="14"
                        key="Add1-7"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Fund]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="55"
                        y="300"
                        width="89"
                        height="14"
                        key="Add1-8"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Date]]></text>
                </staticText>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="148"
                        y="274"
                        width="331"
                        height="12"
                        key="Add1-9"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{TRANSFERRED_FROM}]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        x="148"
                        y="287"
                        width="331"
                        height="14"
                        key="Add1-10"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Fund , Ltd]]></text>
                </staticText>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="148"
                        y="301"
                        width="331"
                        height="14"
                        key="Add1-11"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{DATE_VALUE}]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        x="56"
                        y="330"
                        width="89"
                        height="14"
                        key="Add1-12"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Registered Holder]]></text>
                </staticText>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="149"
                        y="330"
                        width="331"
                        height="12"
                        key="Add1-13"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{TRANSFERRED_TO}]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement
                        x="149"
                        y="343"
                        width="331"
                        height="14"
                        key="Add1-14"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Fund , Ltd]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="56"
                        y="343"
                        width="89"
                        height="14"
                        key="Add1-15"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Fund]]></text>
                </staticText>
                <staticText>
                    <reportElement
                        x="56"
                        y="356"
                        width="89"
                        height="14"
                        key="Add1-16"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <text><![CDATA[Date]]></text>
                </staticText>
                <textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
                    <reportElement
                        x="149"
                        y="357"
                        width="331"
                        height="14"
                        key="Add1-17"
                        positionType="Float"
                        isRemoveLineWhenBlank="true"/>
                    <box></box>
                    <textElement>
                        <font .../>
                    </textElement>
                <textFieldExpression   class="java.lang.String"><![CDATA[$P{DATE_VALUE}]]></textFieldExpression>
                </textField>
            </band>
        </detail>
</jasperReport>

非常感谢有关调试的帮助

1 个答案:

答案 0 :(得分:2)

您正从主报表将报表连接$P{REPORT_CONNECTION}作为数据源传递到子报表。

这意味着在子报表中我们希望查询详细信息区域显示数据(我无法在子报表中找到此查询)。

由于您愿意: (通过评论发现)

所有数据作为参数传递,您不希望在子报告中执行任何查询

解决方案是:

在子报告中,textField放入详细信息区域(我们的数据源为0记录,细节带不会显示),使用另一个频段,例如title频段。

  

对于数据源中的每条记录重复jasper报告中的详细信息带,您没有记录,因此不会重复/显示。

此外,您需要在子报告whenNoDataType="AllSectionsNoDetail"标记上设置属性jasperReport,否则它将为空(因为我们有无数据,0条记录,默认为{ {1}})。有关其他信息,请参阅WhenNoDataTypeEnum

其他说明:

您还应该更加谨慎地在报告中指明noPagespageHeightmargins的子报告可能不适合在&#34; main&#34;报告pageHeight="792"pageHeight="792",因此 792&gt; 772

修改:添加了波段定义,因为OP对此有一些评论(编辑是从Understanding-iReport-Elements复制的):

  

标题这是报告的第一个频段,仅打印   一次。此区域用于打印文档的标题和   整个iReport中只需要一次的信息。

     

页面标题这就像每页的标题并打印在每页上   那个报告 。这用于在页面上设置标题信息。

     

列标题与页面标题一样,此频段会在每个页面上打印,但它会打印出来   仅在该页面上有详细信息带时打印。

     

细节这是所有人中最有用和最棘手的乐队,这个乐队是   重复打印数据源中的每一行。在列表中   emp_detail报告,为每个emp_detail打印。

     

列页脚如果有详细信息区,则会在每页上打印   那个页面。如果报告属性中的浮动列页脚是   选中后,列页脚将显示在最后一个数据的正下方   列,否则它将显示在页面的底部   (在页脚上方)。

     

页脚此区域是插入页码的有用位置。如果   最后一页页脚设置为此页面打印在除每页之外的每页上   最后一页,如果未设置“最后页面页脚”,则打印它   最后一页也是。

     

最后一页页脚这打印在文档的末尾,全部   完成文本和信息可以在这个区域打印。

     

摘要这用于结束文档,只打印一次   在报告的最后。

     

背景此部分用于设置背景图像   文档,是插入水印图像进行报告的好地方   页