lourdh
lourdh

Reputation: 459

Pentaho Report Designer 5.0.1 - Hide field with Empty field

I am using Pentaho report designer 5.0 CE.

My report is having two groups, and one group contains row band with elements and values like,

Group1 Group2 Label1 - Value1 Label2 - Value2 Label3 - Value3 ...

I need to show a row only if the value is not empty(without leaving blank space). I set the 'invisible-consumes-space' property to false (band level). The blank space is still there.

how could i hide a label & value (entire row) if the value is empty?

Upvotes: 1

Views: 4939

Answers (2)

Ozland
Ozland

Reputation: 89

have you tried to put the label element and value element in a band. assumingly value is printed by name field.

this is your band.

-----------------
|label  | name  |
-----------------

select the band from structure tree and go to style tab->size&position -> visible option. then open the expression tab and paste

=IF(ISBLANK([Name]);"False"; "True")

OR

=IF(LEN([Name])<=0;"False"; "True")

I use the one below to hide all the group headers & footers when there is no data.

  1. set no data band -> hide-on-canvas option to false. Add a message field and let's say 'No data available for selected date range'
  2. And set all Report Header & Footer's visible option to:

=IF(ISEMPTYDATA();"False"; "True")

And it works. Hope helps to you too.

Upvotes: 2

Thomas Morgner
Thomas Morgner

Reputation: 331

And empty string is not the same as an invisible element. Use the "visible" style instead and add your formula to the band's "visible" style setting to hide the band and all its subbands.

Upvotes: 1

Related Questions