如何在jasper报告中的段后添加break

时间:2012-04-09 06:48:00

标签: jasper-reports

我想问一下。如何在一个文本字段中添加段落。 例如,

报告是一种文本作品(通常是写作,演讲,电视或电影),其目的是为了传递信息。

就像这样: -

"A report is a textual work  line 1

(usually of writing, speech, television, or film) line 2

 made with the specific intention of line 3

 relaying information" line 4

1 个答案:

答案 0 :(得分:8)

您可以使用 \n (换行符)符号,也可以使用标记语法。

样本:

<title>
    <band height="167" splitType="Stretch">
        <textField isStretchWithOverflow="true">
            <reportElement x="414" y="38" width="100" height="20"/>
            <textElement markup="styled"/>
            <textFieldExpression><![CDATA["A report is a textual work <br/>(usually of writing, speech, television, or film) <br/>made with the specific intention of <br/> relaying information"]]></textFieldExpression>
        </textField>
        <textField isStretchWithOverflow="true">
            <reportElement x="26" y="38" width="100" height="20"/>
            <textElement/>
            <textFieldExpression><![CDATA["A report is a textual work\n(usually of writing, speech, television, or film)\nmade with the specific intention of \nrelaying information"]]></textFieldExpression>
        </textField>
    </band>
</title>

有关使用样式文字is here的更多信息。