我已經使用 & amp; amp; 而不是「&」,它正在碧玉報告中工作。
<style pdfFontName="Helvetica-BoldOblique" isBold="true" isItalic="true"
forecolor="red">Instruction &amp; instruction</style>
//在文本字段中我使用了樣式標籤。
<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" >
<reportElement
x="0"
y="0"
width="290"
height="15"
key="textField"
isRemoveLineWhenBlank="true"/>
<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" rightPadding="5" bottomBorder="None" bottomBorderColor="#000000"/>
<textElement textAlignment="Center" isStyledText="true">
<font size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[<style pdfFontName="Helvetica-BoldOblique" isBold="true" isItalic="true"
forecolor="red">Instruction &amp; instruction</style>]]></textFieldExpression>
</textField>
謝謝,但它仍然無法正常工作。如果我寫出「&」超出樣式標記,它正在工作,但是,當我將它寫入樣式標記時,它不起作用。 –
你的*標記*是什麼? –
@IshwarPohani您可以將* jrxml *中的確切片段添加到您的問題中嗎?我會盡力檢查你的表情 –