将扩展列表项添加到页脚页带(Jasper Report)

时间:2014-10-15 07:05:57

标签: jasper-reports ireport

是否可以通过增加List组件的详细信息来扩展页脚的高度。我创建了一个测试jasper报告来模拟这种情况。这是jrxml

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="footer_test" language="groovy" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="1ab4a8b2-176a-422c-b4e2-afd6b2f5c01e">
    <property name="ireport.zoom" value="1.0"/>
    <property name="ireport.x" value="0"/>
    <property name="ireport.y" value="0"/>
    <subDataset name="dataset1" uuid="cd6ab13b-6111-4e9f-897b-afe354e16a24">
        <queryString>
            <![CDATA[select t.first_name,t.last_name from test_footer as `t` limit 0,3;]]>
        </queryString>
        <field name="first_name" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
        <field name="last_name" class="java.lang.String">
            <fieldDescription><![CDATA[]]></fieldDescription>
        </field>
    </subDataset>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="79" splitType="Stretch"/>
    </title>
    <pageHeader>
        <band height="35" splitType="Stretch"/>
    </pageHeader>
    <columnHeader>
        <band height="61" splitType="Stretch"/>
    </columnHeader>
    <detail>
        <band height="125" splitType="Stretch"/>
    </detail>
    <columnFooter>
        <band height="45" splitType="Stretch"/>
    </columnFooter>
    <pageFooter>
        <band height="54" splitType="Stretch">
            <frame>
                <reportElement uuid="4d39142a-5378-4c16-9f34-7bcfe334f8aa" x="0" y="0" width="555" height="33" isPrintWhenDetailOverflows="true"/>
                <componentElement>
                    <reportElement uuid="4292c68b-c14a-4edd-9077-19164fcab508" x="0" y="0" width="555" height="33" isPrintWhenDetailOverflows="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="dataset1" uuid="b787c354-2d90-45c7-9927-2106939bb2da">
                            <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                        </datasetRun>
                        <jr:listContents height="33" width="555">
                            <textField>
                                <reportElement uuid="1ca36f79-f891-4e45-83fd-c3e4cdb44b92" x="0" y="0" width="100" height="20"/>
                                <textElement/>
                                <textFieldExpression><![CDATA[$F{first_name}]]></textFieldExpression>
                            </textField>
                            <textField>
                                <reportElement uuid="21fb2a6e-4a3d-488b-a203-136c63e3c5f0" x="322" y="0" width="100" height="20"/>
                                <textElement/>
                                <textFieldExpression><![CDATA[$F{last_name}]]></textFieldExpression>
                            </textField>
                            <line>
                                <reportElement uuid="3c56f817-e07f-4dde-9d7a-89a4bea76c2d" x="0" y="20" width="266" height="1"/>
                            </line>
                            <line>
                                <reportElement uuid="716e36f4-884a-431c-b483-a005cbaf966a" x="322" y="21" width="219" height="1"/>
                            </line>
                        </jr:listContents>
                    </jr:list>
                </componentElement>
            </frame>
            <line>
                <reportElement uuid="0dfbaf15-6aa5-4560-ba8f-824b35df2914" x="0" y="33" width="555" height="1" forecolor="#0033FF" backcolor="#0033CC"/>
                <graphicElement>
                    <pen lineWidth="4.0" lineColor="#0033FF"/>
                </graphicElement>
            </line>
            <textField pattern="MM/dd/yyyy h:mm a">
                <reportElement uuid="1406ccec-0c5c-450b-a6e8-91aeda0d0619" x="0" y="34" width="166" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
            </textField>
        </band>
    </pageFooter>
    <summary>
        <band height="42" splitType="Stretch"/>
    </summary>
</jasperReport>

但是现在列表中的所有项目都没有打印,可能是因为页脚带高度不够。 enter image description here

但是当我增加页脚带的高度时,所有项目都会打印出来。enter image description here

所以,我的问题是,当List组件中的项目增加时,是否有办法增加页脚带高度。我需要在页脚中添加List组件,因为它会迭代用户签名。 < / p>

0 个答案:

没有答案