none
How to hide a column or more than one column based on a column value SSRS

    Question

  • Hi All,

                    I have an existing report to which i had added couple of columns for a requirement. I had to hide these columns based on a column value Say 'Column1'. how can i acheive this in SSRS.

    any help would be really appreciated

    Thanks 

    chaithanya M


    Regards Chaithu.. If it is usefull,Mark this as Answer.

    Sunday, November 25, 2012 4:23 PM

Answers

  • Hi Chaitanya,

    You can use an expression in the visibility property of the column you want to hide. For example, if you want to hide Column A if ColumnB = '"ABC" then use the following expression in the visibility property of ColumnA.

    =IIF(Fields!ColumnB.Value = "ABC", TRUE, FALSE)

    Hope this helps!


    Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com


    Sunday, November 25, 2012 7:43 PM

All replies

  • Hi Chaitanya,

    You can use an expression in the visibility property of the column you want to hide. For example, if you want to hide Column A if ColumnB = '"ABC" then use the following expression in the visibility property of ColumnA.

    =IIF(Fields!ColumnB.Value = "ABC", TRUE, FALSE)

    Hope this helps!


    Shahfaisal Muhammed http://shahfaisalmuhammed.blogspot.com


    Sunday, November 25, 2012 7:43 PM
  • Hi Chaithanya,

    Add a visibility toggle when you want to enable a user to interactively show or hide report items or, for a table or matrix, rows and columns associated with a group. To toggle the visibility for an item, you set the visibility properties for the item that you want to show or hide. For more information about how to add a visibility toggle to an item, please see:
    http://msdn.microsoft.com/en-us/library/ms156456(v=sql.100).aspx

    In you scenario, you want to hide columns base on another column’s value, right? As Shahfaisal said, you can use an expression like:
    =IIF(Fields!Column1.Value = "ABC", TRUE, FALSE)
    However, this expression can only get the first record value of column1, in another words, the column is hide or not only base on the first record value of column1. If you want to set the visibility of column base each of records, you can set the text-box visibility of this column.

    If you have any questions, please feel free to ask.

    Regards,
    Charlie Liao


    Charlie Liao
    TechNet Community Support

    Monday, November 26, 2012 7:52 AM