SSRS 2008 Removing white space when hiding elements
Asked Answered
D

5

6

I have been trying to resolve this simple issue for a few hours with no joy.

I have two tables within my SSRS 2008 report which are bound to different datasets and I need to show or hide the appropriate table based on a passed in parameter. This I have done with the hidden property of the table which works as expected. The problem I have is that when hiding the top item and showing the item beneath it I get the white space from the hidden item.

Trivial example

I created two tables and bound them to the same datasource laying them vertically.

enter image description here

I then set the hidden property of the top table to true and previewed the report.

enter image description here

You can see that the first grid is hidden but the white space remains. From my investigations I did see the ConsumeContainerWhitespace property used for this but in my case it did not clear up the white space.

Question

Is there a method of removing the white space for these hidden elements?

Deni answered 15/10, 2015 at 8:40 Comment(7)
You could try embedding both tables within another larger table that has 1 column and two rows. Put a table in each cell, and then change the visibility of the row depending on the parameter?Punnet
Did try that but it complains with this error - "the tablix includes a table header or column with fixed header set to true". Can't see whyDeni
I've just tested on a report I have, and have been able to get it to work. Id right click each table and check that "Keep headers visible" is not ticked.Punnet
The "Keep header visible while scrolling" is unticked on both row and column headers for both tables.Deni
In that case, only thing I can say is do a search in the XML of the rdl file for "fixed" and see what it is that is set to true. If nothing comes up, then its got to be a bug in SSRS!Punnet
Ok, manually editing the RDL resolved that issue and I was able to create the table and hide the row with the RowVisibility and presto no white space. One issue I have is that in the actual implementation the two tables have different datasets, does this present an issue when you have to specify a dataset in the parent container table?Deni
Let us continue this discussion in chat.Punnet
P
2

I would recommend two solutions depending on whether the datasets are the same.

1: If they share a common dataset then I would nestle them in another table that has 1 column, and 2 rows, and then change the row visibility depending on the parameters.

2: If the datasets are different, I would make each table a sub-report and then change the visibility that way.

Just another workaround caused by SSRS quirks!

Punnet answered 15/10, 2015 at 10:57 Comment(0)
C
2

The behavior can be controlled by following method

1) Right click on the top left box on the tablix and click on 'Tablix Properties' to open the properties for the tablix
2) Click on the "Visibilty" tab on the left hand side of the wizard
3) Click on the "Show or hide based on an expression", click on the Fx and paste the following formula

=IIF(RowNumber("DatasetName")=0,TRUE,FALSE)

4) Make sure to replace the "DatasetName" with the your dataset name (the one that is related to the tablix)
5) Also make sure that the ConsumeContainerWhiteSpace property is set to "True"

ConsumeContainerWhiteSpace property is a report level property and can be changed from properties window for the report. (click on the report outside of the design area)

This worked for me very well.

Collator answered 1/5, 2017 at 15:56 Comment(0)
P
1

This can be fixed by ensuring that the reports ConsumeContainerWhiteSpace property is set to true.

This can be found in the report properties. Click the yellow surround for the report, press F4 to open the Properties pane, and you can find ConsumeContainerWhiteSpace under there.

enter image description here

See also ConsumeContainerWhitespace property to remove blank space in SSRS 2008 report

Pseudaxis answered 15/10, 2015 at 8:58 Comment(1)
As I stated in my question I have already tried that and it did not resolve the issue.Deni
D
0

Select the object, go to properties and set the size to 0,0

Dorcia answered 5/12, 2018 at 22:16 Comment(0)
W
-1

Wired. Only contained them in another tablix or subreport then it works in hide them with no white space.

Waziristan answered 19/12, 2020 at 17:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.