避免将文本字段拆分为多个页面 [英] Avoid split of text field to multiple pages

查看:288
本文介绍了避免将文本字段拆分为多个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a main report and in the main report a sub report called this:

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

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

There is a problem in the subreport because text fields in the detail band are split up on multiple pages what doesn't look very nice. Is there an option to prevent text fields from splitting up to multiple pages when using the property 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>

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

Example on how it looks (sorry for the missing data):

推荐答案

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

Yes there is, but not on the text field. For the band the text field is in, you can set the Split Type to Prevent. if you set that on the Detail Band and the row needs to overflow to next page, it will move the entire row to the next page.

这篇关于避免将文本字段拆分为多个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆