Jasper iReport 变量 char 的表达式条件
我的数据库中有一个列,它是 ColorCode 列(字段名称 $F{COLORCODE} ),其中包含“B”、“R”和“G”等值,我想分别根据它们的颜色计算它们的数量。
所以我有一个名为 countBlue 的变量,变量表达式为 $F{COLORCODE}=='B' 并将其放在列页脚中,但报告计算了该列中的所有内容,包括 R 和 G,我是否错误地执行了比较语句?
我还设置了 countBlue 变量类为 java.lang.Integer,计算为 Count 并将类型重置为 Report
p/s 抱歉英语不好
I have a column in my database, which is the ColorCode column (Field name $F{COLORCODE} ) that has values like 'B' and 'R' and 'G', I want to count the amount of them respectively to their color.
So I have variables called countBlue, the variables expression is $F{COLORCODE}=='B' and put it in the Column Footer but the report counted everything including the R and G in that column, did I do the comparison statement wrongly?
also I have set up my countBlue variable class to java.lang.Integer, calculation as Count and reset type as Report
p/s sorry for bad english
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用此表达式(计算:计数;重置类型:报告;增量类型:无):
或此(计算:无;重置类型:报告; 增量类型: 无):
您可以在此处阅读有关变量的信息。
JasperReports 终极指南 说:
You can use this expression (Calculation: Count; Reset type: Report; Increment type: None):
or this (Calculation: Nothing; Reset type: Report; Increment type: None):
You can read about variables here.
The JasperReports Ultimate Guide says: