Count number of rows where a field is a specific value

后端 未结 2 610
悲&欢浪女
悲&欢浪女 2021-01-14 07:43

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 tri

2条回答
  •  生来不讨喜
    2021-01-14 08:32

    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).

提交回复
热议问题