如何在jasper报告中下标字段 [英] How to subscript a field in jasper report

查看:144
本文介绍了如何在jasper报告中下标字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使字段显示为SubScript或显示文本基线下方的字段。

当字体应用于报表时,我必须使用USPSIMBStandard字体应该打印的信息跳转向上或隐藏文本字段的上部区域,当我将信息的任何部分复制到单词和下标时,它显示正确。

How to make a field to show as a SubScript or to show the field below the text base line.
I have to use USPSIMBStandard font when the font applies to the report the information that should print jumps up or hide the upper area of the text field, when i copy the whatever portion of the information to the word and subscript it, it shows correctly.

推荐答案

您可以使用样式标记来解决此任务,并使用< sub> 标记下标文本和< sup> 上标文字的标记。

You can use styled markup for solving this task and the <sub> tag for subscript text and the <sup> tag for the superscript text.

jrxml 文件:

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test_markup" language="groovy" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="c3c991dc-b3f2-4d45-b429-821e33c5324d">
    <title>
        <band height="55" splitType="Stretch">
            <textField isStretchWithOverflow="true">
                <reportElement uuid="6b947a69-22bb-4a63-9e56-cacc75747df0" x="115" y="17" width="324" height="20"/>
                <textElement markup="styled">
                    <font isUnderline="false" isStrikeThrough="false"/>
                </textElement>
                <textFieldExpression><![CDATA["Text with<sup>superscript</sup> \nText with<sub>subscript</sub>"]]></textFieldExpression>
            </textField>
        </band>
    </title>
</jasperReport>

结果将是(通过 iReport 预览):

The result will be (via preview in iReport):

注意:

Notes:

  • You can find sample about using markup in Style a text field in JasperReports post
  • More info about markup is here

这篇关于如何在jasper报告中下标字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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