我是iReport的新手,正在使用iReport 5.6.0尝试根据条件显示文本.假设我有两个变量,分别为Cr和Dr.我想在Cr>Dr时显示文本Net Profit,在Dr>Cr时显示文本Net Loss.我正在尝试像这样的事情.
I am new in iReport and using iReport 5.6.0 I was trying to show a text based on a condition. Suppose, I have two variables name Cr and Dr. And I want to show a text Net Profit when Cr>Dr and Net Loss when Dr>Cr. I was trying something like this.
($ V {Dr_total} pareTo($ V {Cr_total})?净利润":净亏损")
($V{Dr_total}pareTo($V{Cr_total} )? "Net Profit": "Net Loss" )
有关在iReport中使用用户定义的表达式的任何详细教程都将非常有帮助.预先感谢.
And any details tutorial about Using User Defined Expression in iReport would be very much helpful. Thanks in advance.
推荐答案已解决.在表达时打印"中,我使用了类似的方法.仅在满足此条件时显示文本.
It's solved. In Print When Expression I used something like this. The text is only showing when this condition is fulfilling.
$ V {Dr_total} .intValue()< = $ V {Cr_total} .intValue()吗? Boolean.TRUE:Boolean.FALSE
$V{Dr_total}.intValue()<= $V{Cr_total}.intValue() ? Boolean.TRUE:Boolean.FALSE
更多推荐
在ireport中使用表达式
发布评论