在ireport中使用表达式

编程入门 行业动态 更新时间:2024-10-16 21:27:36
本文介绍了在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} 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中使用表达式

本文发布于:2023-11-22 01:29:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1615443.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表达式   ireport

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!