隐藏多个细节带
我有一个包含子报告的报告,用于向主报告添加徽标。在此子报告中,我有 2 个细节带来支持两个不同大小的徽标;一个是长的,另一个是大约三分之一长(宽度)的。有点像这样...
........................... |---------logo------------| address 1, address 2 ........................... |__logo__| address 1 | | address 2 ...........................
第一行和第二行之间是详细信息 1 区域,第二行和第三行之间是详细信息 2 区域。
我正在尝试使用“Print When Expression”根据 $F{LogoName}
的值切换第一个或第二个细节带。
细节1频段:
new Boolean($F{LogoName}=="acompanyname")
细节2频段:
new Boolean($F{LogoName}!="acompanyname")
但不起作用。
还尝试过这些:
(($F{LogoName}=="acompanyname")?Boolean.TRUE:Boolean.FALSE)
(($F{LogoName}!="acompanyname")?Boolean.TRUE:Boolean.FALSE)
$F{LogoName}
是“acompanyname”。
每次我运行报告时,仅显示详细信息 2 波段。我根本无法显示详细信息 1,也没有收到任何错误消息。
欢迎任何帮助。
谢谢
I have a report with a subreport to add a logo to the main report. In this subreport I have 2 detail bands to support two differently sized logos; one is long and the other is about a 3rd a long (width). kind of like this...
........................... |---------logo------------| address 1, address 2 ........................... |__logo__| address 1 | | address 2 ...........................
Between the 1st and 2nd row of periods is the Details 1 band and between the 2nd and 3rd is Details 2 band.
I am trying to use the "Print When Expression" to toggle the 1st or 2nd Detail band depending on the value of $F{LogoName}
.
Detail 1 band:
new Boolean($F{LogoName}=="acompanyname")
Detail 2 band:
new Boolean($F{LogoName}!="acompanyname")
but it does not work.
Have also tried these:
(($F{LogoName}=="acompanyname")?Boolean.TRUE:Boolean.FALSE)
(($F{LogoName}!="acompanyname")?Boolean.TRUE:Boolean.FALSE)
The $F{LogoName}
is "acompanyname".
Every time I run the report only Detail 2 band shows. I can not get details 1 to show at all and I am not getting any error messages.
Any help is welcome.
Thank You
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个:
在 Java 中,等号运算符 (
==
) 在对象上使用时,会检查它们是否是对同一对象的相同引用。这适合所有没有大量 Java 编程经验的报表开发人员。您可以这样写:这将返回
true
,如您所料,因为 equals 运算符两侧的两个对象是相同的。考虑以下情况:此打印:
字符串对象的值相同,但对字符串的引用不同。 equals 运算比较引用,而不是值。
Try this:
In Java, the equality operator (
==
), when used on objects, checks to see if they are the same reference to the same object. This one catches all report developers without a lot of Java programming experience. You could write:That would return
true
, as you expect, because both objects on either side of the equals operator are the same. Consider the following:This prints:
The values of the strings objects are the same, but the references to the strings are different. The equals operation compares the references, not the values.