J Weezy
J Weezy

Reputation: 3957

SSRS - Shrink report width when hiding columns

Using SSRS 2013. I am able to hide columns with boolean values, but the report (body) width does not shrink when columns are hidden. Thus, there is excess blank/white space to the right of the report. Is it possible to eliminate this excess space? If yes, kindly will you please advise how?

Upvotes: 1

Views: 3149

Answers (2)

datadevelopr
datadevelopr

Reputation: 53

I ran into this exact same limitation of SSRS. I was able to achieve what I believe you are trying to get (consistent report and report col width when certain columns are hidden due to parameter vals, etc.)- by simply having 2, separately formatted report tablix/tables in the report and hiding/showing based on a parameter (or some SSRS-expressible logic):

1 for the condition when all columns are present; 1 for the condition when some columns are omitted- both of them formatted to utilize all available screen real estate to minimize white space and make things look "clean".

Instead of hiding column(s) when my hidden condition is true- I simply show the 2nd tablix and hide the 1st. And when the filter changes to show all columns, I do the reverse (hide the 2nd tablix and make the 1st visible again).

Not sure if that helps, but I figured I should share if it might aid anybody else facing this issue.

PS: Your tablix Hidden expressions will look something like this:

[the full column tablix].Hidden
=iif(Parameters!parmOmitSomeCols.Value = true, false, true)

[the tablix with some columns omitted].Hidden
=iif(Parameters!parmOmitSomeCols.Value = false, true, false)

Upvotes: 1

iamdave
iamdave

Reputation: 12243

The report body width - as with any column width and unlike heights - is a set value that cannot be changed on execution. You need to either put up with the white space, format your presentation layer to not be affected by the appearance of the white space or redesign your report so the objective of hiding the columns can be achieved in a different way.

Upvotes: 2

Related Questions