Removing unwanted space in a report

There is a little trick in Reporting services that is not easy to find.

I created a report for a client that included an external class which parsed a stream of XML and returned various data from the XML for display in the report. The nature of the data was that not everything is required for each row. For example, each XML document would contain a question and answer given by the end user. Some questions would contain a tip to help the user and others did not.

To make the report generic, I used a table with multiple details bands for each question. Each textbox in the table would go after a different piece on data in the XML. The output of the report looks something like this:

Q: Should golf be 18 holes?
A: No.

Q: How many holes should a round of golf be?
A: 12.
Tip: The answer is 12.

Q: Why 12?
A: It just makes sense.

As you can see, some rows contain a tip and some do not. When the report calls the parser it gets back a “NoData” message indicating that there is no tip for this question. The problem you will find is there will be a space where the empty tip textbox is. (see example)

----------------------------------------------------------------------------------------

Q: Should golf be 18 holes?
A: No.
   [extra space not required]

Q: How many holes should a round of golf be?
A: 12.
Tip: The answer is 12.

Q: Why 12?
A: It just makes sense.
   [extra space not required]

----------------------------------------------------------------------------------------

You might have tried the following.
Put an expression on the textbox's hidden property so that if the NoData message is returned the textbox is made invisible like this:

=iif(Me.Value = "NoData", true, false)

You will find the extra space is still there.

You may have tried to set the text box property CanShrink to True, but the space will still be there.

Here is the trick. Make the height of the textbox zero. Reporting Services will change that to some default like .03 but this is the only way to remove the space. Make sure you set Can Shrink and Can Grow to True.