SSRS. How to hide blank/empty column via expression?

Stanislovas Kalašnikovas picture Stanislovas Kalašnikovas · Mar 2, 2015 · Viewed 17.6k times · Source

I need to hide column if all rows in column is empty (blank).

In this case col3 should be hidden, because no values in column.

col1 col2 col3
 v1   v4
 v2
 v3   

I'm using following expression on columns Hidden property:

=IIF(Fields!Test5.Value = "",TRUE,FALSE)

This expression working, but It hidding each blank(empty) field, even all column isn't empty. It should hide column only when there is no values at all.

Answer

sdrzymala picture sdrzymala · Mar 2, 2015

You can use:

=IIF(Max(Field, Dataset)= "",TRUE,FALSE)

If the maximum value is empty it means that there is nothing, and make your hide expression on column.