• vax09 (9/19/2013) I need to create a report in which I need to hide the column data base on who userid.

    for example if Manager want to see the report then manager can see all the column in report but if Supervisor want to view the same report then he can only see few column.

    ...

    You can easily trigger the visibility property of any table via an expression. In this case the User.UserID

    You have to be aware though, that this is not completely secure. If the user can use a data renderer (xml or csv), all data will be included - they do not honor visibility.

    If you cannot risk that, you need to run two different queries, again parameterized by the expression UserID and then return an empty column for certain users.

    If you combine both approaches you have the flexibility in the presentation as well as the flexibility in the backend, where you can create tables with groups of people who see certain data and others not, which you can join to a DataSet when needed.

    Andreas

    ---------------------------------------------------
    MVP SQL Server
    Microsoft Certified Master SQL Server 2008
    Microsoft Certified Solutions Master Data Platform, SQL Server 2012
    www.insidesql.org/blogs/andreaswolter
    www.andreas-wolter.com