Hiding text from a TextBox in Microsoft Report!? RRS feed

  • Question

  • Hello everyone,

    I have a problem writing an expression for hiding a text from a TextBox in Microsoft Report.

    The case is like this, I have a textbox that has a definition of a field. I need to hide the text inside that TextBox when that field is empty.

    For example, I have the word "Name:" inside a TextBox as a definition. and the associated field, which is a textbox dragged from the a dataset, sometimes, I have no names for some certain report, So, when this case happened, then this field will be empty, and its definition will still show i.e the word "Name" inside the TextBox. Now, the question is, how to hide that TextBox with the word "Name".

    Another question, how to hide a Table in a report  if its fields are empty for the same reason as the TextBox?

    Thank you very much,

    Best Wishes,


    Tuesday, March 10, 2009 2:58 AM

All replies

  • For the text box, you can try and expression in the visibility property of the text box.

    =iif(ReportItems!textbox1.Value = "Name:", false, true)

    The same type of principle applies to a table visibility clause.

     =IsNothing(Fields!Column1.Value) or =iif(IsNothing(Fields!Column1.Value),false, true)

    Brad Syputa, Microsoft Reporting Services This posting is provided "AS IS" with no warranties.
    Tuesday, March 10, 2009 7:49 PM