如何下标碧玉报告中的字段

fah*_*had 2 jasper-reports

如何使字段显示为 SubScript 或在文本基线下方显示该字段。
当字体应用于报告时,我必须使用 USPSIMBStandard 字体,应该打印的信息会跳起来或隐藏文本字段的上部区域,当我将信息的任何部分复制到单词并为其添加下标时,它显示正确。

Ale*_*x K 5

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

样品

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>
Run Code Online (Sandbox Code Playgroud)

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

在此处输入图片说明

笔记: