문제

How do I count how many rows there are where the address field is null (or any other value), and then print the total in the Summary band?

I've tried using variables, but couldn't seem to get it working.

  • JasperServer 5.0.1
  • iReport 5.5.0
도움이 되었습니까?

해결책 2

Add a variable with these properties:

Variable class : java.lang.Integer
Caculation : Sum
Reset Type : Report
Increment type : Group
Increment group : YourGroupName
Variable expression : $F{yourField}.equals("") ? 0 : 1

다른 팁

Declare a variable $V{countNull} with properties:

Variable class = java.lang.Integer
Calculation = Sum
ResetType = Report
Increment type = None
Variable expression = $F{address} != null ? 0 : 1

Put $V{countNull} into the Summary band.

Put $V{countNull} into Detail band to see its calculation (for debugging).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top