为什么在js:list组件中得到不同的结果?

时间:2018-08-28 04:01:53

标签: jasper-reports

我在碧玉报告中使用了jr:list组件。我的报告如下所示:

<background>
        <band splitType="Stretch"/>
    </background>
    <detail>
        <band height="37" splitType="Stretch">
            <textField>
                <reportElement positionType="FixRelativeToBottom" isPrintRepeatedValues="false" mode="Opaque" x="0" y="0" width="513" height="37" isPrintInFirstWholeBand="true" backcolor="#CCCCCC" uuid="123c1330-2ed6-436c-90d7-49820b8d47b1"/>
                <box>
                    <topPen lineWidth="0.75"/>
                    <leftPen lineWidth="0.75"/>
                    <bottomPen lineWidth="0.75"/>
                    <rightPen lineWidth="0.75"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
                    <font fontName="Arial" size="8" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["SUMMARY"]]></textFieldExpression>
            </textField>
        </band>
        <band height="256" splitType="Stretch">
            <componentElement>
                <reportElement stretchType="RelativeToTallestObject" x="0" y="2" width="514" height="20" uuid="eb5b00f3-c370-4c7f-bb10-b7589ff293ff"/>
                <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="listDataset" uuid="f7dbd610-a453-4692-87b5-ace0329bbe11">
                        <datasetParameter name="REPORT_DATE">
                            <datasetParameterExpression><![CDATA[$P{REPORT_DATE}]]></datasetParameterExpression>
                        </datasetParameter>
                        <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
                    </datasetRun>
                    <jr:listContents height="20" width="514">
                        <textField isStretchWithOverflow="true">
                            <reportElement stretchType="RelativeToTallestObject" x="0" y="2" width="328" height="18" uuid="d307fa41-0962-4b17-812d-774262e55e9e"/>
                            <textFieldExpression><![CDATA[$F{LABEL_VALUE}]]></textFieldExpression>
                        </textField>
                        <textField isStretchWithOverflow="true">
                            <reportElement stretchType="RelativeToTallestObject" x="328" y="2" width="185" height="18" uuid="fa972e53-dc8a-402e-96ad-9428b402ccd8"/>
                            <textFieldExpression><![CDATA[$F{ATTRIBUTE_VALUE}]]></textFieldExpression>
                        </textField>
                    </jr:listContents>
                </jr:list>
            </componentElement>
        </band>
    </detail>
    <pageFooter>
        <band splitType="Stretch"/>
    </pageFooter>
    <summary>
        <band splitType="Stretch"/>
    </summary>
    <noData>
        <band height="200">
            <textField>
                <reportElement positionType="FixRelativeToBottom" isPrintRepeatedValues="false" mode="Opaque" x="0" y="0" width="513" height="37" isPrintInFirstWholeBand="true" backcolor="#CCCCCC" uuid="123c1330-2ed6-436c-90d7-49820b8d47b1"/>
                <box>
                    <topPen lineWidth="0.75"/>
                    <leftPen lineWidth="0.75"/>
                    <bottomPen lineWidth="0.75"/>
                    <rightPen lineWidth="0.75"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
                    <font fontName="Arial" size="8" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA["SUMMARY"]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="0" y="39" width="417" height="20" uuid="fb562548-2f38-4d3d-84a5-118b2cd354d3"/>
                <textElement>
                    <font fontName="Arial" size="8"/>
                </textElement>
                <textFieldExpression><![CDATA["No data to be displayed in this report"]]></textFieldExpression>
            </textField>
        </band>
    </noData>

在报告中,我的数据集查询返回20行,但是jr:list组件仅显示11行。

其余的隐藏吗?我是否需要调整乐队的身高? 请帮助我!

0 个答案:

没有答案