如何在页面底部放置带有向上拉伸的文本?

发布于 2025-01-29 18:17:21 字数 1589 浏览 1 评论 0原文

我需要在最后一页上放置动态免责声明。目标是将其放在页面底部附近(如果有帮助的话,我可以将其放入页脚中),然后将其增长 /伸展向上< / em>。

我尝试了:

<summary>
    <band height="250" splitType="Stretch">
        <rectangle>
            <reportElement mode="Transparent" x="1" y="1" width="736" height="248" forecolor="#000000" uuid="eab6a45c-8a83-414b-b6d2-89ca9320f533">
            </reportElement>
            <graphicElement>
                <pen lineWidth="1.0" lineStyle="Dotted" lineColor="#FF8080"/>
            </graphicElement>
        </rectangle>
        <textField textAdjust="StretchHeight">
            <reportElement positionType="FixRelativeToBottom" key="" mode="Opaque" x="0" y="220" width="738" height="13" forecolor="#000066" backcolor="#F5F5F5" uuid="c169a12b-718a-431e-81c1-33731dc633ee">
            </reportElement>
            <textElement verticalAlignment="Bottom">
                <paragraph leftIndent="10" rightIndent="10" spacingBefore="7" spacingAfter="7"/>
            </textElement>
            <textFieldExpression>"Footer\n\nSecond paragraph.\n\nThird paragraph."</textFieldExpression>
        </textField>
    </band>
</summary>

但是测试菲尔德仍然向下延伸;将有第二页,或者文本将被切断。我期望positionType =“ fixRelativetobottom”保留底部坐标并收缩结果的y坐标。

有一个技巧我如何实现这一目标?

要求:

  • 1-3段文本的不同语言(因此无法提前告诉文本字段的高度)。这样可以防止诸如9个字段之类的技巧,其中8个字段总是被看不见/忽略。
  • 免责声明周围的灰色背景应适合文本(因此背景中没有矩形,然后在其上打印文本)。
  • 如果您打印不同版本的免责声明,则将纸质表彼此放置时,背景的底部边缘应对齐

I need to put a dynamic disclaimer on the last page. The goal is to have it near the bottom of the page (I can put it in the footer if that helps) and grow / stretch upwards.

I tried:

<summary>
    <band height="250" splitType="Stretch">
        <rectangle>
            <reportElement mode="Transparent" x="1" y="1" width="736" height="248" forecolor="#000000" uuid="eab6a45c-8a83-414b-b6d2-89ca9320f533">
            </reportElement>
            <graphicElement>
                <pen lineWidth="1.0" lineStyle="Dotted" lineColor="#FF8080"/>
            </graphicElement>
        </rectangle>
        <textField textAdjust="StretchHeight">
            <reportElement positionType="FixRelativeToBottom" key="" mode="Opaque" x="0" y="220" width="738" height="13" forecolor="#000066" backcolor="#F5F5F5" uuid="c169a12b-718a-431e-81c1-33731dc633ee">
            </reportElement>
            <textElement verticalAlignment="Bottom">
                <paragraph leftIndent="10" rightIndent="10" spacingBefore="7" spacingAfter="7"/>
            </textElement>
            <textFieldExpression>"Footer\n\nSecond paragraph.\n\nThird paragraph."</textFieldExpression>
        </textField>
    </band>
</summary>

but the testfield still stretches downwards; there will either be a second page or the text will be cut off. I was expecting positionType="FixRelativeToBottom" to preserve the bottom coordinate and shrink the Y coordinate of the result.

Is there a trick how I can achieve this?

Requirements:

  • 1-3 paragraphs of text in different languages (so no way to tell in advance how high the text field will be). This prevents tricks like 9 fields where 8 are always invisible/ignored.
  • Gray background around the disclaimer which should fit the text (so no rectangle in the background and then print text over it).
  • If you print different versions of the disclaimer, the bottom edge of the background should align when you put the paper sheets on top of each other

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文