【问题标题】:Issue with textField position and isStretchWithOverflow baseline shiftingtextField 位置和 isStretchWithOverflow 基线偏移问题
【发布时间】:2013-01-10 21:05:17
【问题描述】:

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

简单的 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 高度。

我看不到任何可以访问的单元格填充,我无法弄清楚。如果是功能,是否有关闭开关?

【问题讨论】:

  • 可以发截图吗?
  • 您是否在 JRXML 或链接样式参考中定义了默认样式?

标签: jasper-reports


【解决方案1】:

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

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-04-15
    • 1970-01-01
    • 1970-01-01
    • 2019-01-14
    • 2012-02-12
    • 2021-06-25
    • 1970-01-01
    相关资源
    最近更新 更多