Report ,subreport pentaho

555 views Asked by At

Iam using Pentaho report designer and we want to hide a subreport if there is no data .

I have tried to use this formula :

not(isemptydata())

in the visible expression but it does not seem to work .

So how to hide a subreport if no data .

1

There are 1 answers

0
ChoCho On

Pentaho Report Designer elements have "attributes" and "style" sections. In style section there is a field "Visible". If you don't want to make the sub-report visible, it must be set to "false".

When want a function to disable it, the expression must return a "FALSE()" value.

You don't specify how the sub-report is generated and where is it placed (Details, Report Footer, etc), but, I'm gonna assume you have defined a function that has the count of rows for a group "TOTAL_ROWS" (and this is gonna be the field you are gonna compare), so, to hide the sub-report when 0 rows are present:

=IF([TOTAL_ROWS] = 0; FALSE(); TRUE())

"if the total number of rows is zero, return false, else return true".