Make hidden table column take no space in SSRS 2008 R2

不羁岁月 提交于 2020-01-01 07:34:06

问题


Has anyone figured out a good way to make a hidden table/matrix column take no horizontal space?

I could use some crazy conditionals to dynamically determine the contents of the columns (effectively sliding them leftward as far as possible), but that is nasty, plus doesn't allow for varying column widths in the columns to the right of the one I want to hide.

The idea is that when a parameter is set to "Any" then the column with the corresponding value should display. But when the parameter is set to an explicit single value the report doesn't need to contain that column any more (it will be separately listed as a condition at the top of the report).

This lets me use the same report in different situations, some requiring hiding unnecessary columns.

P.S. I think Microsoft should add expressions for object sizes, and I think they should add CanShrinkHorizontally to the CanShrink(Vertically) that already exists...


回答1:


I think you are looking at the Hidden property of the column. Something that is hidden will still take up space. What you want to change is the Visibility of the column. Right click on the column header and click Column Visibility and set it there.




回答2:


It looks like you can hide groups, and groups can be rows or columns.

Click the down-arrow next to "Column Groups" at the bottom of the Design pane, and turn on Advanced Mode. Modify the Hidden property of the Static group representing the desired column. Poof! You've made the entire column take up no space.




回答3:


I struggled with this and came up with a workaround/solution.

In my scenario it was critical to have the RowGroups EffectiveDate, Description AND TransactionID. I wanted to hide the TransactionID column, because it was part of the grouping I couldn't set the Columns Visibility.

Before

After

So what I did was Merge Cells for the Description/TransactionID Header (and called it Transaction Type) and also for the first row of the tablix "Opening Balance".

Set the TransactionID textbox Hidden: True

The trick was to make the [DESCRIPTION] Right BorderStyle: None

Then set the Cell under [TRANSACTIONID] Top BorderStyle: Solid and Top BorderWidth 0.5

Alternatively make the fore color of the column you want to hide white and set border styles appropriately.



来源:https://stackoverflow.com/questions/6062639/make-hidden-table-column-take-no-space-in-ssrs-2008-r2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!