Print When Expression in iReport

亡梦爱人 提交于 2019-12-05 02:40:49

问题


I am trying to do a simple expression in iReport, but whatever I try seems has given me an error. It seems like such a simple thing to do, but whenever I try to do anything in Java it takes me about 20 tries to get it right.

All I'm trying to do is show a subreport when the value of an integer field is not zero. I am using the Print When Expression for the subreport control.

Here's a few (of the many) things that I've tried:

$F{count}!=0

$F{count}!=Integer(0)

!$F{count}.compareTo(0)

Obviously my Java sucks. Any help would be appreciated. Thanks.


回答1:


new Boolean($F{count}.intValue()!=0)

Glad that I could help.




回答2:


w00t! 35th time's a charm. I finally got the following expression to work. If anyone can tell me why, I would appreciate it.

new Boolean($F{count}.compareTo(new Integer(0))!=0)


来源:https://stackoverflow.com/questions/14731262/print-when-expression-in-ireport

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