Search code examples
reporting-servicesexpressionwhitespacessrs-2012show-hide

Hiding nested tables not working, showing A LOT of white space SSRS


So, I have a report in SSRS that contains 5 tables nested in each other all with 2 columns. We have working expressions for every table in "show and hide based on an expression" on textbox visibility, but instead of hiding the chosen tables it shows a lot of white space in the supposedly occupied area. We have been trying to reduce the white space but with minimal success. We hide the tables based on parameter values, example below:

Parameters!prmName.Value=false

=IIF(Parameters!prmName.Value= true, IIF(Parameters!prmText.Value=true, False, True), True)

The second one is for the second column which one also can hide if that parameter is chosen to be hidden.

The expressions look almost the same except some parameter names and so on.

There is 1 parameter for every table aka 5 which we use when hiding each of them.

We have tried using this in row visibility IIF(Trim(ReportItems!Name.Value) = "", true, false), but as we said it did not work.

We have also tried visibility on the tables' groups unsuccessfully.

--------------EDIT---------------

So each table is representing a kind of level. Like the first, and most outer table is a letter and the second outer table is an undergroup of the first table and so on:

A

01

011

0111

01110

01111

012

0121

01210

B

05

051

0511

05110

And so on...

In all tables, there is a text explaining the row and a subreport which contains some further information. The most inner table contains 2 subreports.

How the levels should look without the extra information

And this is how it looks when we try to hide the extra information

The blank space only increases when hiding chosen tables.

This is how the main report looks at the moment

The Expressions contain simple text explaining the level. The [ExprX] contains more detailed info about the level and then the subreport contains even further details.

This nesting became necessary because we only wanted to show levels once. Before that, it was repeating.

Hope this makes it clearer


Solution

  • Found a solution for our problem. Instead of trying to remove the white space we decided to never load the tabels data through several case with expressions in the query builder. Also noticed that such a 'difficult' query (with cases and stuff) had to be made in the "edit as text" inside the query builder.

    Example below:

    SELECT 
    CASE WHEN @prmLevel1 = 'true' THEN Table.ColumnName 
    ELSE NULL 
    END AS ColumnName
    FROM Table
    

    But with lots of more cases after each other.

    Hope this can be of help to someone! Have a great day!