在ireport中使用表达式 [英] Using expressions in ireport
问题描述
我是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} .compareTo($ V {Cr_total})?净利润":净亏损")
($V{Dr_total}.compareTo($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中使用表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!