textField position和isStretchWithOverflow基线移位问题 [英] Issue with textField position and isStretchWithOverflow baseline shifting

查看:215
本文介绍了textField position和isStretchWithOverflow基线移位问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 textField 元素的JasperReport。

I have a JasperReport with a textField element.

简单XML:

<textField isStretchWithOverflow="true">
  <reportElement uuid="2e3604dd-1f53-44d6-ab66-b3e41732955b" x="247" y="229" width="232" height="20"/>
  <textElement>
    <font fontName="CBSwiss721BT-Light"/>
  </textElement>
  <textFieldExpression>
    <![CDATA[$F{meetingPurpose}]]>
  </textFieldExpression>
</textField>

如果字段的长度 meetingPurpose 值小于 textField 的宽度,它打印得很漂亮,但是如果长度导致文本换行并拉伸 textField ,则文本基线向下移动1/2 X高度。

If the length of field's meetingPurpose value is less than the width of the textField, it prints beautifully, however if the length causes the text to wrap and stretch the textField, the text is baseline shifted down 1/2 X height.

我没有看到任何类似我可以访问的单元格填充,我无法弄清楚这一点。如果它是一个功能,是否有一个关闭开关?

I don't see anything like cell padding that I can access and I cannot figure this out. If it is a feature, is there an off switch?

推荐答案

我可能正在读你的问题,但是,访问Padding右键单击元素选择填充和边框

I may be reading your problem all wrong but, to access Padding right click on the element pick padding and borders

它会改变你的xml看起来像这样

it will alter your xml to look like this

<textField isStretchWithOverflow="true" isBlankWhenNull="true">
    <reportElement x="0" y="0" width="100" height="20"/>
    <box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1"/>
    <textElement/>
    <textFieldExpression><![CDATA[$F{SYSDATE}]]></textFieldExpression>
</textField>

这篇关于textField position和isStretchWithOverflow基线移位问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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