我有靜態的文本在下面的其他顯示一個staticText元素的列表:如何刪除空值?
A
B
C
D
E
我需要的元素的情況下崩潰其中一些不會被打印顯示一個JasperReports的報告的列表。 (這些靜態文本是標籤,如果相應的值在表達式中打印時不會被打印)
示例:如果B爲null,則輸出應該如下所示。 (C,d,E應該向上浮動)
A
C
D
E
我一直沒能得到它使用性質的工作,例如刪除線當空,位置類型爲浮動等沒有property 空白時爲空爲靜態文本,就像那裏的文本字段。這個東西適用於文本字段。
我想出了示例代碼。請讓我知道,如果這種情況下有什麼問題:
<detail>
<band height="170" splitType="Stretch">
<staticText>
<reportElement uuid="df801bc0-7c70-42c3-bc34-a8d735a96388" positionType="Float" x="88" y="15" width="100" height="20" isRemoveLineWhenBlank="true"/>
<textElement/>
<text><![CDATA[A]]></text>
</staticText>
<staticText>
<reportElement uuid="bdeb24d3-74b9-4b93-a2ad-451732e500b5" positionType="Float" x="88" y="35" width="100" height="20" isRemoveLineWhenBlank="true"/>
<textElement/>
<text><![CDATA[B]]></text>
</staticText>
<staticText>
<reportElement uuid="e68dc5fd-ed4f-46e0-aa5d-be1edc652aa3" positionType="Float" x="88" y="55" width="100" height="20" isRemoveLineWhenBlank="true"/>
<textElement/>
<text><![CDATA[]]></text>
</staticText>
<staticText>
<reportElement uuid="0b7481b2-33cd-4573-84b2-4a6738ca0ee3" positionType="Float" x="88" y="75" width="100" height="20" isRemoveLineWhenBlank="true"/>
<textElement/>
<text><![CDATA[D]]></text>
</staticText>
<staticText>
<reportElement uuid="2b45cded-10f3-46b5-a87b-5c844e61b247" positionType="Float" x="88" y="95" width="100" height="20" isRemoveLineWhenBlank="true"/>
<textElement/>
<text><![CDATA[E]]></text>
</staticText>
</band>
</detail>
有沒有人解決過這個問題?
如果你正在談論*靜態文本*,是什麼理由添加這個元素的* Null *值?你可以發佈* jrxml *文件嗎? –
正如我所說,「這些靜態文本是標籤,如果相應的值爲null時使用打印表達式時不會打印」 - 我有一個表單元素列表'Label:Value',如果值爲標籤,則不顯示標籤爲空 – anon
您能否與我們分享您的jrxml?這將使診斷問題變得更容易。 – GenericJon