我有静态的文本在下面的其他显示一个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