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

Unexpected vertical space List component


Recommended Posts

I have used nested component list in the detail band and noticed extra space inside the inner list. Can someone suggest me to remove the additional space between Tracking Number: 1Z90AV790311117898 and 1Z90AV790311117899.

JRXML:

<detail>
        <band height="56" splitType="Stretch">
            <componentElement>
                <reportElement x="4" y="1" width="545" height="55" uuid="7d3851e2-9d6c-4b5b-b256-5e3fd1983313"/>
                <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="InnerLineDetail" uuid="581ce50a-7a06-4450-94f4-22b8832ebb05">
                        <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{shipmentLineItem})]]></dataSourceExpression>
                    </datasetRun>
                    <jr:listContents height="55" width="545">
                        <textField>
                            <reportElement x="3" y="2" width="39" height="18" isRemoveLineWhenBlank="true" uuid="e90d9058-03d2-4c74-ba58-23c680f547f3"/>
                            <textFieldExpression><![CDATA[$F{itemNumber}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="43" y="2" width="113" height="18" isRemoveLineWhenBlank="true" uuid="05366782-7ca3-4c40-aa6b-f827ad1dcd8e"/>
                            <textFieldExpression><![CDATA[$F{materialNumber}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="158" y="1" width="253" height="20" isRemoveLineWhenBlank="true" uuid="f34a79f3-abaa-4e96-8c96-61b76151606b"/>
                            <textElement textAlignment="Left"/>
                            <textFieldExpression><![CDATA[$F{description}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="164" y="22" width="257" height="17" isRemoveLineWhenBlank="true" uuid="0e50363f-f50b-41e2-b3d6-0b7e83836cf3"/>
                            <textFieldExpression><![CDATA[$F{stoNumber}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="412" y="7" width="52" height="23" isRemoveLineWhenBlank="true" uuid="9bf292e0-eba2-4494-9cf3-5c800a4c134a"/>
                            <textFieldExpression><![CDATA[$F{qtyOrdered}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="487" y="8" width="52" height="23" isRemoveLineWhenBlank="true" uuid="6471b280-20cf-4c68-9998-4eb916a0b0ce"/>
                            <textFieldExpression><![CDATA[$F{qtyShipped}]]></textFieldExpression>
                        </textField>
                        <staticText>
                            <reportElement x="99" y="22" width="73" height="17" uuid="566341a8-c707-4d8a-a6b9-c0792dd6f3f1"/>
                            <textElement>
                                <font fontName="SansSerif" size="10" isBold="true"/>
                                <paragraph lineSpacing="Single"/>
                            </textElement>
                            <text><![CDATA[sTO Number:]]></text>
                        </staticText>
                        <staticText>
                            <reportElement x="99" y="38" width="91" height="17" uuid="566341a8-c707-4d8a-a6b9-c0792dd6f3f1"/>
                            <textElement>
                                <font fontName="SansSerif" size="10" isBold="true"/>
                                <paragraph lineSpacing="Single"/>
                            </textElement>
                            <text><![CDATA[Tracking Number:]]></text>
                        </staticText>
                        <componentElement>
                            <reportElement x="1" y="1" width="541" height="51" uuid="7d3851e2-9d6c-4b5b-b256-5e3fd1983313"/>
                            <jr:list printOrder="Vertical">
                                <datasetRun subDataset="trackingDetail" uuid="581ce50a-7a06-4450-94f4-22b8832ebb05">
                                    <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{trackingNumbers})]]></dataSourceExpression>
                                </datasetRun>
                                <jr:listContents height="51" width="541">
                                    <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                                        <reportElement x="190" y="37" width="179" height="14" isRemoveLineWhenBlank="true" uuid="6471b280-20cf-4c68-9998-4eb916a0b0ce"/>
                                        <textFieldExpression><![CDATA[$F{trackingnumber}]]></textFieldExpression>
                                    </textField>
                                </jr:listContents>
                            </jr:list>
                        </componentElement>
                    </jr:listContents>
                </jr:list>
            </componentElement>
        </band>
    </detail>

 

 

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Resolved by using Jasper Studio plugin to Eclipse.

Working JRXML:

    <detail>
        <band height="56" splitType="Stretch">
            <componentElement>
                <reportElement x="4" y="1" width="545" height="55" uuid="7d3851e2-9d6c-4b5b-b256-5e3fd1983313"/>
                <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="InnerLineDetail" uuid="581ce50a-7a06-4450-94f4-22b8832ebb05">
                        <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{shipmentLineItem})]]></dataSourceExpression>
                    </datasetRun>
                    <jr:listContents height="55" width="545">
                        <textField>
                            <reportElement x="3" y="2" width="39" height="18" isRemoveLineWhenBlank="true" uuid="e90d9058-03d2-4c74-ba58-23c680f547f3"/>
                            <textFieldExpression><![CDATA[$F{itemNumber}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="43" y="2" width="113" height="18" isRemoveLineWhenBlank="true" uuid="05366782-7ca3-4c40-aa6b-f827ad1dcd8e"/>
                            <textFieldExpression><![CDATA[$F{materialNumber}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="158" y="1" width="253" height="20" isRemoveLineWhenBlank="true" uuid="f34a79f3-abaa-4e96-8c96-61b76151606b"/>
                            <textElement textAlignment="Left"/>
                            <textFieldExpression><![CDATA[$F{description}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="232" y="21" width="257" height="17" isRemoveLineWhenBlank="true" uuid="0e50363f-f50b-41e2-b3d6-0b7e83836cf3"/>
                            <textFieldExpression><![CDATA[$F{stoNumber}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="412" y="7" width="52" height="23" isRemoveLineWhenBlank="true" uuid="9bf292e0-eba2-4494-9cf3-5c800a4c134a"/>
                            <textFieldExpression><![CDATA[$F{qtyOrdered}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="487" y="8" width="52" height="23" isRemoveLineWhenBlank="true" uuid="6471b280-20cf-4c68-9998-4eb916a0b0ce"/>
                            <textFieldExpression><![CDATA[$F{qtyShipped}]]></textFieldExpression>
                        </textField>
                        <staticText>
                            <reportElement x="167" y="21" width="73" height="17" uuid="566341a8-c707-4d8a-a6b9-c0792dd6f3f1"/>
                            <textElement>
                                <font fontName="SansSerif" size="10" isBold="true"/>
                                <paragraph lineSpacing="Single"/>
                            </textElement>
                            <text><![CDATA[sTO Number:]]></text>
                        </staticText>
                        <staticText>
                            <reportElement x="167" y="37" width="91" height="17" uuid="566341a8-c707-4d8a-a6b9-c0792dd6f3f1"/>
                            <textElement>
                                <font fontName="SansSerif" size="10" isBold="true"/>
                                <paragraph lineSpacing="Single"/>
                            </textElement>
                            <text><![CDATA[Tracking Number:]]></text>
                        </staticText>
                        <componentElement>
                            <reportElement x="253" y="37" width="247" height="16" uuid="33288373-3faa-40c0-a220-7ee76fe720d8"/>
                            <jr:list printOrder="Vertical">
                                <datasetRun subDataset="trackingDetail" uuid="581ce50a-7a06-4450-94f4-22b8832ebb05">
                                    <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{trackingNumbers})]]></dataSourceExpression>
                                </datasetRun>
                                <jr:listContents height="16" width="247">
                                    <textField>
                                        <reportElement x="0" y="0" width="247" height="16" uuid="a8b5b3e6-9014-42ec-91de-511f3a63053f"/>
                                        <textFieldExpression><![CDATA[$F{trackingnumber}]]></textFieldExpression>
                                    </textField>
                                </jr:listContents>
                            </jr:list>
                        </componentElement>
                    </jr:listContents>
                </jr:list>
            </componentElement>
        </band>
    </detail>

Link to comment
Share on other sites

Resolved by changing the JRXML as given below.

 <detail>
        <band height="56" splitType="Stretch">
            <componentElement>
                <reportElement x="4" y="1" width="545" height="55" uuid="7d3851e2-9d6c-4b5b-b256-5e3fd1983313"/>
                <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/componentshttp://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
                    <datasetRun subDataset="InnerLineDetail" uuid="581ce50a-7a06-4450-94f4-22b8832ebb05">
                        <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{shipmentLineItem})]]></dataSourceExpression>
                    </datasetRun>
                    <jr:listContents height="55" width="545">
                        <textField>
                            <reportElement x="3" y="2" width="39" height="18" isRemoveLineWhenBlank="true" uuid="e90d9058-03d2-4c74-ba58-23c680f547f3"/>
                            <textFieldExpression><![CDATA[$F{itemNumber}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="43" y="2" width="113" height="18" isRemoveLineWhenBlank="true" uuid="05366782-7ca3-4c40-aa6b-f827ad1dcd8e"/>
                            <textFieldExpression><![CDATA[$F{materialNumber}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="158" y="1" width="253" height="20" isRemoveLineWhenBlank="true" uuid="f34a79f3-abaa-4e96-8c96-61b76151606b"/>
                            <textElement textAlignment="Left"/>
                            <textFieldExpression><![CDATA[$F{description}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="232" y="21" width="257" height="17" isRemoveLineWhenBlank="true" uuid="0e50363f-f50b-41e2-b3d6-0b7e83836cf3"/>
                            <textFieldExpression><![CDATA[$F{stoNumber}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="412" y="7" width="52" height="23" isRemoveLineWhenBlank="true" uuid="9bf292e0-eba2-4494-9cf3-5c800a4c134a"/>
                            <textFieldExpression><![CDATA[$F{qtyOrdered}]]></textFieldExpression>
                        </textField>
                        <textField>
                            <reportElement x="487" y="8" width="52" height="23" isRemoveLineWhenBlank="true" uuid="6471b280-20cf-4c68-9998-4eb916a0b0ce"/>
                            <textFieldExpression><![CDATA[$F{qtyShipped}]]></textFieldExpression>
                        </textField>
                        <staticText>
                            <reportElement x="167" y="21" width="73" height="17" uuid="566341a8-c707-4d8a-a6b9-c0792dd6f3f1"/>
                            <textElement>
                                <font fontName="SansSerif" size="10" isBold="true"/>
                                <paragraph lineSpacing="Single"/>
                            </textElement>
                            <text><![CDATA[sTO Number:]]></text>
                        </staticText>
                        <staticText>
                            <reportElement x="167" y="37" width="91" height="17" uuid="566341a8-c707-4d8a-a6b9-c0792dd6f3f1"/>
                            <textElement>
                                <font fontName="SansSerif" size="10" isBold="true"/>
                                <paragraph lineSpacing="Single"/>
                            </textElement>
                            <text><![CDATA[Tracking Number:]]></text>
                        </staticText>
                        <componentElement>
                            <reportElement x="253" y="37" width="247" height="16" uuid="33288373-3faa-40c0-a220-7ee76fe720d8"/>
                            <jr:list printOrder="Vertical">
                                <datasetRun subDataset="trackingDetail" uuid="581ce50a-7a06-4450-94f4-22b8832ebb05">
                                    <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{trackingNumbers})]]></dataSourceExpression>
                                </datasetRun>
                                <jr:listContents height="16" width="247">
                                    <textField>
                                        <reportElement x="0" y="0" width="247" height="16" uuid="a8b5b3e6-9014-42ec-91de-511f3a63053f"/>
                                        <textFieldExpression><![CDATA[$F{trackingnumber}]]></textFieldExpression>
                                    </textField>
                                </jr:listContents>
                            </jr:list>
                        </componentElement>
                    </jr:listContents>
                </jr:list>
            </componentElement>
        </band>
    </detail>

Link to comment
Share on other sites

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