避免将文本字段拆分为多个页面

Mic*_*hel 3 jasper-reports

我有一份主要报告,在主要报告中有一份子报告称:

<detail>
    <band height="50">
        <subreport>
            <reportElement x="0" y="1" width="802" height="49" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true"/>
            <subreportParameter name="project_id">
                <subreportParameterExpression><![CDATA[$P{project_id}]]></subreportParameterExpression>
            </subreportParameter>
            <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
            <subreportExpression><![CDATA["subs/Project_planned.jasper"]]></subreportExpression>
        </subreport>
    </band>
</detail>
Run Code Online (Sandbox Code Playgroud)

子报表中存在一个问题,因为详细信息区域中的文本字段在多个页面上分开,看起来不太好.是否有一个选项可以防止文本字段在使用属性时分割为多个页面isStretchWithOverflow

文本字段的当前代码

                <textField isStretchWithOverflow="true" isBlankWhenNull="true">
                <reportElement stretchType="RelativeToBandHeight" x="555" y="0" width="99" height="21" isPrintInFirstWholeBand="true" forecolor="#000000"/>
                <box leftPadding="2">
                    <topPen lineWidth="1.0" lineColor="#000000"/>
                    <leftPen lineWidth="1.0" lineColor="#000000"/>
                    <bottomPen lineWidth="1.0" lineColor="#000000"/>
                    <rightPen lineWidth="1.0" lineColor="#000000"/>
                </box>
                <textElement verticalAlignment="Middle">
                    <paragraph lineSpacing="Single"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{logic}]]></textFieldExpression>
            </textField>
Run Code Online (Sandbox Code Playgroud)

它的外观示例(抱歉缺少数据):

避免在多个页面上拆分文本字段

Jac*_*oen 12

是的,但在文本字段上没有.对于文本字段所在的波段,您可以将"分割类型"设置为Prevent.如果你在Detail Band上设置它并且该行需要溢出到下一页,它会将整行移动到下一页.

  • 我已经通过添加新变量来更改它,并按组而不是按页重置它.目前,这解决了这个问题.感谢您的回答和评论.Jasper的报道很棒且无限,但有时候会很痛苦;-) (2认同)