Programmer666
Programmer666

Reputation: 31

Hiding Textbox in SSRS and freeing up space

I am designing a report using SSRS 2008 R2 where there can be 2-3 sub headers. Now the headers are passed as parameters showing different options such as date range etc.Now I have used three TextBoxes for the three headers but the problem is if I pass 2 headers and even if the third TextBox is hidden it takes up space. I would have used a tablix had the headers appeared in a body section but It seems I cannot use a tablix in the header section. I hope I was able to make myself clear. Does anyone have any answers regarding this.

Thanks.

Upvotes: 3

Views: 4557

Answers (3)

Michael Reck
Michael Reck

Reputation: 97

If I may make a suggestion, that I've used before, use placeholders. So, what you do is go into the box that is right before the optional text box. Then, right click. You should see an option at the bottom for Create Placeholder. Click that and it will ask you to create an expression. Do an IIF check on your variable.

Example: IIF(MyVar = 1, vbcrlf + "My Header", "")

What this will do is check to see if MyVar = 1. If it does, then it appends onto your text box a new line with the text "My Header". Otherwise, it will take up no space.

Please let me know if this helps and good luck with your project.

Upvotes: 3

tezzo
tezzo

Reputation: 11115

You have to 'play' with 3 properties of your TextBoxes.

  • CanGrow: True
  • CanShrink: True
  • Hidden: =IIf(Parameters!YourParameter.Value = "", True, False)

To save space, you can also set a minimum Height for your TextBoxes and put them attached to each other.

Upvotes: 1

Manoj
Manoj

Reputation: 631

you have to change the visiblity:

1)select textbox 2)right click on text box. 3) go to Text Box Properties 4)visiblity tab>click on "fx" for expression and write following code.

use if condition:

=IIF(Cstr(Header.value))="",TRUE,FALSE)

i hope it will solve ur issue.

Upvotes: 0

Related Questions