我的报告中有一个条形图。在某些情况下,从 Java 应用程序发送的对象列表是空的。在那种情况下,我想在报告中隐藏条形图,但我做不到。如果有人可以帮助我,那就太好了。
问问题
939 次
2 回答
0
您可以在图表和/或包含它的波段上设置“表达式时打印”。
于 2013-07-03T17:18:46.467 回答
0
添加这个<printWhenExpression><![CDATA[$F{male}==10]]></printWhenExpression>
您可以在此处指定条件: <![CDATA[$F{male}==10]]>
完整的解决方案
<barChart>
<chart isShowLegend="false" evaluationTime="Report">
<reportElement x="0" y="5" width="201" height="131" >
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<printWhenExpression><![CDATA[$F{male}==10]]></printWhenExpression>
</reportElement>
<chartTitle>
<titleExpression><![CDATA["Population"]]></titleExpression>
</chartTitle>
<chartSubtitle/>
<chartLegend/>
</chart>
....
于 2017-10-17T09:26:10.373 回答