我想要一对取决于值的文本字段。并且“y”值应根据空白空间进行调整。
当值为"0"
我想隐藏文本字段。
IE。我想隐藏staticText
和textField
如果参数red
等于"0"
并将蓝色值向上移动,在下面的 jrxml 代码中:
<staticText>
<reportElement x="100" y="30" width="100" height="30"/>
<text><![CDATA[Red items:]]></text>
</staticText>
<textField>
<reportElement x="200" y="30" width="40" height="30"/>
<textFieldExpression>
<![CDATA[$P{red}]]>
</textFieldExpression>
</textField>
<staticText>
<reportElement x="100" y="60" width="100" height="30"/>
<text><![CDATA[Blue items:]]></text>
</staticText>
<textField>
<reportElement x="200" y="60" width="40" height="30"/>
<textFieldExpression>
<![CDATA[$P{blue}]]>
</textFieldExpression>
</textField>
输出示例:
//if blue = 3 and red = 2 if blue = 3 and red = 0 if blue = 0 and red = 2
Red items: 2 Blue items: 3 Red items: 2
Blue items: 3
这些文本字段将放置在我的报告的末尾。我怎样才能做到这一点?
<reportElement ...>
<printWhenExpression><![CDATA[$P{red} == 0]]></printWhenExpression>
</reportElement>
您可以使用 iReport 来修改它,并提供令人愉悦的 UI。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)