Jump to content
We've recently updated our Privacy Statement, available here ×

Remove line when blank not working incase of list


nehasinghrajput346

Recommended Posts

I am using jasper report 4.5.1 to generate the report.I have applied some condition in my inner frame .The condition is working fine but when no data it is displaying white space .

I have already applied "Remove Line When Blank=True" but still I can see the space.

I have pasted my jrxml.Please help me out to know where I am going wrong?

 

<band height="204">    <printWhenExpression><![CDATA[$F{Name}!=null]]></printWhenExpression>    <frame>        <reportElement positionType="Float" x="1" y="1" width="573"            height="203" isRemoveLineWhenBlank="true" />        <frame>            <reportElement positionType="Float" x="67" y="1" width="506"                height="200" isRemoveLineWhenBlank="true" />            <box>                <leftPen lineWidth="1.0" />            </box>            <textField isStretchWithOverflow="true" isBlankWhenNull="true">                <reportElement positionType="Float" x="7" y="2" width="474"                    height="17" isRemoveLineWhenBlank="true" />                <textElement>                    <font fontName="Arial" size="12" isBold="true" />                </textElement>                <textFieldExpression><![CDATA[$F{Name}]]></textFieldExpression>            </textField>            <textField isStretchWithOverflow="true" isBlankWhenNull="true">                <reportElement style="INFO_STYLE"                    positionType="Float" x="7" y="187" width="490" height="12"                    isRemoveLineWhenBlank="true" forecolor="#000000">                    <printWhenExpression><![CDATA[$P{TEST_INFO}!=null && $P{TEST_INFO}.length()>0]]></printWhenExpression>                </reportElement>                <textElement verticalAlignment="Bottom">                    <font fontName="Arial" size="8" />                </textElement>                <textFieldExpression><![CDATA[$P{TEST_INFO}]]></textFieldExpression>            </textField>            <componentElement>                <reportElement positionType="Float" x="7" y="172"                    width="495" height="14" isRemoveLineWhenBlank="true" />                <jr:list                    xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components"                    xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"                    printOrder="Vertical">                    <datasetRun subDataset="List1">                        <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource) $P{REPORT_DATA_SOURCE}).subDataSource("Class/Test")]]></dataSourceExpression>                    </datasetRun>                    <jr:listContents height="14" width="495">                        <textField isStretchWithOverflow="true" isBlankWhenNull="true">                            <reportElement style="STYLE2"                                positionType="Float" x="0" y="0" width="495" height="14"                                isRemoveLineWhenBlank="true" forecolor="#000000" />                            <textElement verticalAlignment="Bottom">                                <font fontName="Arial" size="8" />                            </textElement>                            <textFieldExpression><![CDATA[$F{Remark}]]></textFieldExpression>                        </textField>                    </jr:listContents>                </jr:list>            </componentElement>            <frame>                <reportElement positionType="Float" x="1" y="20"                    width="504" height="151" isRemoveLineWhenBlank="true">                    <printWhenExpression><![CDATA[$F{Display}.equalsIgnoreCase("FALSE")]]></printWhenExpression>                </reportElement>                <box>                    <leftPen lineWidth="0.0" />                </box>                <textField isStretchWithOverflow="true" isBlankWhenNull="true">                    <reportElement positionType="Float" x="7" y="1"                        width="38" height="14" isRemoveLineWhenBlank="true" forecolor="#615B5B" />                    <textElement verticalAlignment="Bottom">                        <font fontName="Arial" size="11" isBold="true" />                    </textElement>                    <textFieldExpression><![CDATA[$R{l_Phone}+":"]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true" isBlankWhenNull="true">                    <reportElement positionType="Float" x="46" y="1"                        width="451" height="14" isRemoveLineWhenBlank="true" forecolor="#666666" />                    <textElement verticalAlignment="Bottom">                        <font fontName="Arial" size="11" />                    </textElement>                    <textFieldExpression><![CDATA[$F{VendorPhone}!=null?$F{VendorPhone}:$R{l_NotApplicable}]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true" isBlankWhenNull="true">                    <reportElement positionType="Float" x="7" y="61"                        width="76" height="14" isRemoveLineWhenBlank="true" forecolor="#615B5B" />                    <textElement textAlignment="Left" verticalAlignment="Bottom">                        <font fontName="Arial" size="11" isBold="true" isPdfEmbedded="true" />                        <paragraph lineSpacing="Single" />                    </textElement>                    <textFieldExpression><![CDATA[$R{Drop}+":"]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true" isBlankWhenNull="true">                    <reportElement positionType="Float" x="7" y="15"                        width="55" height="14" isRemoveLineWhenBlank="true" forecolor="#615B5B" />                    <textElement verticalAlignment="Bottom">                        <font fontName="Arial" size="11" isBold="true" isPdfEmbedded="true" />                    </textElement>                    <textFieldExpression><![CDATA[$R{Pick}+":"]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true" isBlankWhenNull="true">                    <reportElement positionType="Float" x="36" y="106"                        width="457" height="14" isRemoveLineWhenBlank="true" forecolor="#666666" />                    <textElement textAlignment="Left" verticalAlignment="Bottom">                        <font fontName="Arial" size="11" isPdfEmbedded="true" />                        <paragraph lineSpacing="Single" />                    </textElement>                    <textFieldExpression><![CDATA[$F{Rate}!=null?$F{Rate}:$R{l_NotApplicable}]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true" isBlankWhenNull="true">                    <reportElement positionType="Float" mode="Transparent"                        x="7" y="106" width="28" height="14" isRemoveLineWhenBlank="true"                        forecolor="#615B5B" />                    <textElement textAlignment="Left" verticalAlignment="Bottom">                        <font fontName="Arial" size="11" isBold="true" isPdfEmbedded="true" />                        <paragraph lineSpacing="Single" />                    </textElement>                    <textFieldExpression><![CDATA[$R{l_Rate}+":"]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true" isBlankWhenNull="true">                    <reportElement positionType="Float" x="7" y="121"                        width="102" height="14" isRemoveLineWhenBlank="true" forecolor="#615B5B" />                    <textElement textAlignment="Left" verticalAlignment="Bottom">                        <font fontName="Arial" size="11" isBold="true" isPdfEmbedded="true" />                        <paragraph lineSpacing="Single" />                    </textElement>                    <textFieldExpression><![CDATA[$R{l_ReferenceNumber}+":"]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true" isBlankWhenNull="true">                    <reportElement positionType="Float" x="110" y="121"                        width="383" height="14" isRemoveLineWhenBlank="true" forecolor="#666666" />                    <textElement textAlignment="Left" verticalAlignment="Bottom">                        <font fontName="Arial" size="11" isBold="false"                            isPdfEmbedded="true" />                        <paragraph lineSpacing="Single" />                    </textElement>                    <textFieldExpression><![CDATA[$F{Number}!=null?$F{Number}:$R{l_NotApplicable}]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true" isBlankWhenNull="true">                    <reportElement positionType="Float" x="7" y="137"                        width="38" height="14" isRemoveLineWhenBlank="true" forecolor="#615B5B" />                    <textElement verticalAlignment="Bottom">                        <font fontName="Arial" size="11" isBold="true" />                    </textElement>                    <textFieldExpression><![CDATA[$R{l_Status}+":"]]></textFieldExpression>                </textField>                <textField isStretchWithOverflow="true" isBlankWhenNull="true">                    <reportElement positionType="Float" x="46" y="137"                        width="442" height="14" isRemoveLineWhenBlank="true" forecolor="#666666" />                    <textElement verticalAlignment="Bottom">                        <font fontName="Arial" size="11" />                    </textElement>                    <textFieldExpression><![CDATA[$F{Description}==null || $F{Description}.equalsIgnoreCase("")?$R{l_NotApplicable}:$F{Description}]]></textFieldExpression>                </textField>                <elementGroup>                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">                        <reportElement positionType="Float" x="41" y="30"                            width="45" height="14" isRemoveLineWhenBlank="true" forecolor="#615B5B" />                        <textElement verticalAlignment="Bottom">                            <font fontName="Arial" isBold="true" isPdfEmbedded="true" />                        </textElement>                        <textFieldExpression><![CDATA[$R{l_Location}+":"]]></textFieldExpression>                    </textField>                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">                        <reportElement positionType="Float" x="87" y="30"                            width="411" height="14" isRemoveLineWhenBlank="true" forecolor="#666666" />                        <textElement verticalAlignment="Bottom">                            <font fontName="Arial" isPdfEmbedded="true" />                        </textElement>                        <textFieldExpression><![CDATA[$F{PickD}!=null?$F{PickD}:$R{l_NotApplicable}]]></textFieldExpression>                    </textField>                </elementGroup>                <elementGroup>                    <textField isStretchWithOverflow="true" pattern=""                        isBlankWhenNull="true">                        <reportElement positionType="Float" x="114" y="45"                            width="380" height="14" isRemoveLineWhenBlank="true" forecolor="#666666" />                        <textElement verticalAlignment="Bottom">                            <font fontName="Arial" isPdfEmbedded="true" />                        </textElement>                        <textFieldExpression><![CDATA[$F{PickUpDate}]]></textFieldExpression>                    </textField>                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">                        <reportElement positionType="Float" x="41" y="45"                            width="72" height="14" isRemoveLineWhenBlank="true" forecolor="#615B5B" />                        <textElement verticalAlignment="Bottom">                            <font fontName="Arial" isBold="true" isPdfEmbedded="true" />                        </textElement>                        <textFieldExpression><![CDATA[$R{l_DateAndTime}+":"]]></textFieldExpression>                    </textField>                </elementGroup>                <elementGroup>                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">                        <reportElement positionType="Float" x="41" y="76"                            width="45" height="14" isRemoveLineWhenBlank="true" forecolor="#615B5B" />                        <textElement verticalAlignment="Bottom">                            <font fontName="Arial" isBold="true" isPdfEmbedded="true" />                        </textElement>                        <textFieldExpression><![CDATA[$R{l_Location}+":"]]></textFieldExpression>                    </textField>                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">                        <reportElement positionType="Float" x="87" y="76"                            width="411" height="14" isRemoveLineWhenBlank="true" forecolor="#666666" />                        <textElement verticalAlignment="Bottom">                            <font fontName="Arial" isPdfEmbedded="true" />                        </textElement>                        <textFieldExpression><![CDATA[$F{DropD}!=null?$F{DropD}:$R{l_NotApplicable}]]></textFieldExpression>                    </textField>                </elementGroup>                <elementGroup>                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">                        <reportElement positionType="Float" x="41" y="91"                            width="72" height="14" isRemoveLineWhenBlank="true" forecolor="#615B5B" />                        <textElement verticalAlignment="Bottom">                            <font fontName="Arial" isBold="true" isPdfEmbedded="true" />                        </textElement>                        <textFieldExpression><![CDATA[$R{l_DateAndTime}+":"]]></textFieldExpression>                    </textField>                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">                        <reportElement positionType="Float" x="114" y="91"                            width="372" height="14" isRemoveLineWhenBlank="true" forecolor="#666666" />                        <textElement verticalAlignment="Bottom">                            <font fontName="Arial" isPdfEmbedded="true" />                        </textElement>                        <textFieldExpression><![CDATA[$F{DropOffDate}]]></textFieldExpression>                    </textField>                </elementGroup>            </frame>        </frame>        <textField isBlankWhenNull="true">            <reportElement positionType="Float" x="17" y="2" width="50"                height="14" isRemoveLineWhenBlank="true" forecolor="#615B5B">                <printWhenExpression><![CDATA[$F{Display}.equalsIgnoreCase("FALSE")]]></printWhenExpression>            </reportElement>            <textElement>                <font fontName="Arial" size="11" isBold="true" />            </textElement>            <textFieldExpression><![CDATA[$F{PickUpDate}]]></textFieldExpression>        </textField>        <image scaleImage="RealSize">            <reportElement positionType="Float" x="0" y="2" width="17"                height="14" isRemoveLineWhenBlank="true" />            <imageExpression><![CDATA[$P{IMG}]]></imageExpression>        </image>    </frame></band>

 

When list contains one row,it will have no space ,but when the number of line increases,it increases the white space also.

Any idea if some property settings is missing?

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...