在ireport中使用表达式 [英] Using expressions in ireport

查看:70
本文介绍了在ireport中使用表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是iReport的新手,正在使用iReport 5.6.0尝试根据条件显示文本.假设我有两个变量,分别为CrDr.我想在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆