user1298426
user1298426

Reputation: 3717

Jasper - How to remove complete row when 1 perticular field is null?

I want to print pdf something like this

Name         Class        RollNo
-------     ----------   -----------

John      5                <null>

Mark       5               103

Robert    6                104

I need to add condition if RollNo is null then remove that row in 'detail' band.

Upvotes: 0

Views: 884

Answers (1)

dada67
dada67

Reputation: 5093

You can use the report's filter expression or the detail band's print when expression. The filter expression completely skips the record, which is not counted and does not participate in aggregations, while the band's print when expression simply inhibits the band from printing.

<filterExpression>$F{RollNo} != null</filterExpression>

...OR...

<detail>
  <band height="x">
    <printWhenExpression>$F{RollNo} != null</printWhenExpression>
    <textField>
    ...

Upvotes: 2

Related Questions