【问题标题】:jasper report dynamic change font sizejasper 报告动态更改字体大小
【发布时间】:2018-03-18 05:20:06
【问题描述】:

我想知道如何更改字段表达式中的字体大小。这意味着我有两个数据库字段。那么现在我想使用表达式合并这两个字段。

示例: $F{type1} + " 余额为单反:" + $F{type2}

我在字段表达式中编写了这个简单的代码。

但现在的问题是我想将 10px 字体大小设置为 $F{type1} 字段和 12px 字体大小到 $F{type2} 字段。

谢谢

【问题讨论】:

    标签: jasper-reports


    【解决方案1】:

    使用样式文本:

    <textField>
        <reportElement width="300" y="0" x="0" height="200"/>
        <textElement markup="styled"/>
        <textFieldExpression><![CDATA["<style size=\"10\">" + $F{type1} + "</style> Balance is SLR : <style size=\"12\">" + $F{type2} + "</style>"]]></textFieldExpression>
    </textField>
    

    查看有关功能here的一些详细信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-07
      • 2014-07-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-27
      相关资源
      最近更新 更多