Using expressions in ireport

戏子无情 提交于 2021-02-05 12:21:02

问题


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} )? "Net Profit": "Net Loss" )

And any details tutorial about Using User Defined Expression in iReport would be very much helpful. Thanks in advance.


回答1:


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



来源:https://stackoverflow.com/questions/28133238/using-expressions-in-ireport

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!