如何在使用jrxml生成的MS excel标题文本中添加新行



我有一个生成excel表格的jrxml文件。jrxml中的代码行如下所示:

<text><![CDATA[Historical Places]]></text>

在我的excel工作表中,我希望历史和地点显示在两个不同的行。我尝试了一些东西从链接,这是为xml在XML中添加新的换行/换行标记,但它不起作用

这些是我尝试过的一些方法,但都不起作用:

 <text><![CDATA[Historical
                Places]]></text>
 <text><![CDATA[Historical n Places]]></text>
 <text><![CDATA[Historical rn Places]]></text>
 <text><![CDATA[Historical "rn" Places]]></text>
 <text><![CDATA[Historical &#x13&#x10; Places]]></text>
 <text><![CDATA[Historical<br /> Places]]></text>

今天我修复了这个问题。我在jrxml文件中添加了splitType="Stretch",并将高度从29增加到37。

<band height="37" splitType="Stretch">

还对jrxml文件中的reportElement x、y、width参数进行了以下更改。初始x为1040,width为80。

<reportElement mode="Transparent" x="980" y="12" width="100">

修复了这个问题。

不需要更改
<text><![CDATA[Historical Places]]></text>

最新更新