Search code examples
jasper-reports

Jasper Sub Reports Not Being Displayed


I have a main report Calling 2 different sub reports , twice , with different parameters each time

Issues is the display is not coming correctly. LETTEROFACK_TRANSF_LTR , is not coming at all

<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>

One Sub Report is ( the one not being displayed )

<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>

Will appreciate help on debugging same


Solution

  • You are passing from main report the report connection $P{REPORT_CONNECTION}as datasource to the subreport .

    This means that in subreport we expect a query to show data in detail band (I can not find this query in subreport).

    Since you like to: (discovered by comments)

    Pass all data as parameters, you don't want to do any query in subreport,

    The solution is:

    In subreport, do not put the textField's in the detail band (our datasource is with 0 record the detail band will not be displayed), use another band as for example title band.

    The detail band in jasper report is repeated for every record in the datasource, you have no records so it will not be repeated/displayed.

    Furthermore you need to set the attribute whenNoDataType="AllSectionsNoDetail" on the subreports jasperReport tag, otherwise it will be blank (since we have no data, 0 records and default is noPages). For additional information see WhenNoDataTypeEnum

    Other notes:

    You should also be more careful about indicating pageHeight and margins on your reports. A sub report with pageHeight="792" can not fit in a "main" report with pageHeight="792" and topMargin="20", hence 792 > 772

    Edit: added band definition since OP had some comments on this (the edit is copied from Understanding-iReport-Elements):

    Title It is the very first band of the report and is printed only once . This area is used to print title of the document and the information that is needed only once in whole iReport.

    Page Header This is like a title per page and printed on each page of the report . This is used to setup header information on the page .

    Column Header Like page header this band prints on each page,but it prints only if there is a detail band on that page.

    Detail This is the most usefull and tricky band of all , This band is repeatedly prints for each row in the data source. In the List of emp_detail report, it is printed for each emp_detail.

    Column Footer Is printed on each page if there is a detail band on that page. If the Floating column footer in report Properties is checked, then the column footer will be shown just below the last data of the column, otherwise it will be shown at the bottom of the page (above the page footer).

    Page Footer This area is usefull place to insert page numbers. If Last Page Footer is set thab this page prints on each page except the last page,and If Last Page Footer is not set, then it is printed on the last page also.

    Last Page Footer This prints at the end of the document , all finishing text and information can be printed in this area.

    Summary This is used to conclude the document and it prints only once at the end of the report.

    Background This portion is used to set a background image for the document , it is a good place to insert a watermark image for report pages