Hide row (and remove whitespace placeholder) of tablix in Reporting Services 2008

孤街浪徒 提交于 2019-12-03 06:38:40

问题


I have a row in a tablex that I want to hide based on a condition. I can do this with the visibility property and also using CanShrink as well is an option.

I've tried both of these and the best I can do is hide the row (make it invisible), but it keeps the whitespace it takes up - I need to remove the whitespace too so if it is not shown that it doesn't take up paper/viewing space.

I have also made the height of the row very small and put cangrow=true so that that if i populate the field with data based on an expression it will grow to the right size but this is not ideal because there is still 0.03125in of space for the row that is always shown (minimim height) and if it grows it grows to fit the text but not neccessarily the set size I want.

I thought I had done this before in an older version of RS but I can't seem to get it to work correctly in this version (2008).

Any ideas?


回答1:


Try to set the Hidden property of the Static Row Group under the Details Group, in this case the whole row will disappear instead of the content of the textboxes.

If you are using Report Builder, you need to switch to Advanced Mode (make sure that the Properties and the Grouping windows are displayed, go to the upper right side of the Grouping window and press the black triangle):

Click on the second "Static" item under the "(Details)" group and you can set the Hidden property on the Properties window.

Link to MSDN sample




回答2:


A simpler way to get to this option for hiding a row is to right-click on the row header and select "Row Visibility". From there you will get a dialog where to can enter an expression.




回答3:


On the empty row you want to hide, go to the text box properties and go to expressions -> visibility, then show or hide based on an expression and use

=iif(first(Fields!.Value = ""),true,false)




回答4:


I was able to make the rows go away by setting the following 2 properties

textbox.CanShrink row.Hidden I played w/ row.HideIfNoRows and it seems to have no effect in accomplishing the desired outcome described by op.

Click on textbox, these one is in the properties of the textbox (if there are multiple columns, I assume you will have to make this setting for each cell/textbox, in my case, I only had 1 column)

CanShrink=false

For the next property, you have to go into ADVANCED MODE by clicking the down arrow at the right side of the Row Groups/Column Groups pane.

Click on the Row containing the line you would like to hide. The Hidden property can be found in properties pane... This is an alternate way to set Hidden, as opposed to right clicking the Row Header in the actual Tablix.

Hidden= <expression describing when you want the row hidden hidden>

One other note - If you right click the Row Header and choose 'Row Visibility' you get a dialgue. the Row Property dialog has a caption "Show or Hide Based on an expression".

The actual behaviour is It will HIDE the row if the expression evaluates to TRUE. IMHO - this is misleading, at best ambiguous.

Once you understand the property you are actually setting is called HIDDEN, then this makes sense. Until then, I certainly assumed I was setting a property called Visisble... FWIW....




回答5:


Setting row visibility logic is important, but I've learned that sometimes a blank row will still appear, even though its contents are hidden. To solve this, I had to do the following non-intuitive steps, but I did in fact succeed in completely suppressing unwanted white space.

  1. In the cell in the tablix region, use the Insert > Rectangle menu option.
  2. In the rectangle, use the Insert > Textbox menu option. Resize as needed.
  3. In the textbox, right-click and enter a placeholder.
  4. Set the value of the placeholder expression to whatever you need.


来源:https://stackoverflow.com/questions/3214326/hide-row-and-remove-whitespace-placeholder-of-tablix-in-reporting-services-200

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