【发布时间】:2011-02-18 16:10:49
【问题描述】:
我想要一对取决于值的 TextField。并且“y”值应根据空白进行调整。
当值为"0"时,我想隐藏TextField。
即如果参数red 等于"0" 并且蓝色值向上移动,我想隐藏staticText 和textField,在下面的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
这些文本字段将放置在我的报告的末尾。我该怎么做?
【问题讨论】:
标签: java jasper-reports conditional