Jasper reports 在报表中联接数据集上字段的所有值
我在JasperReports报告中有一个数据集,它有两个字段ID和Name 我想为报表本身编写过滤表达式,也就是说,只有当数据集上的所有名称值都有字符串“Success”时,才应该显示报表 比方说, 数据集中有两个元组,如Jasper reports 在报表中联接数据集上字段的所有值,jasper-reports,field,Jasper Reports,Field,我在JasperReports报告中有一个数据集,它有两个字段ID和Name 我想为报表本身编写过滤表达式,也就是说,只有当数据集上的所有名称值都有字符串“Success”时,才应该显示报表 比方说, 数据集中有两个元组,如 Case 1: (1,'Failure') (2,'Success') Case 2: (1,'Success') (2,'Success') Actual Result: Case 1 & Case 2: report is displayed Exp
Case 1:
(1,'Failure')
(2,'Success')
Case 2:
(1,'Success')
(2,'Success')
Actual Result:
Case 1 & Case 2: report is displayed
Expected Result:
Case 1: report should be displayed
Case 2: report should not be displayed.
My Expression:
"Success".equals($F{Name}) ? Boolean.TRUE : Boolean.FALSE
即使Name字段中的任何一个字段都有“Success”字符串,我的当前表达式也会返回true
因此,我需要一个有效的表达式来提供上述预期结果
请帮助我。您的问题是什么?更新了问题。请查收。谢谢你的评论
“Success”.equals($F{Name})?Boolean.TRUE:Boolean.FALSE
-您的表达式看起来正确我的表达式返回TRUE,即使名称字段中的任何一个字段有“Success”。但我只想在数据集中所有名称字段的值都为“Success”时返回true。或者我们可以得到数据集中Name字段的所有值吗?然后我可以在表达式中使用它。比如将名称字段值转换为ArrayList之类的?我在问题中发现了类似的需求,但它是针对Sql server reporting services的。