Hide specific columns in the Report

  • Hi all,

    I have such columns in the report:

    CustomerCode, CustomerName,SupplierCode,SupplierName.

    As well, I have a filter Type that can has three values: Customer, Supplier, ALL.

    When I choose 'ALL' - I would like to see all 4 columns.

    When I choose 'Customer' - I would like to see only 2 columns - CustomerCode, CustomerName

    When I choose 'Supplier' - I would like to see only 2 columns - SupplierCode,SupplierName.

    I change expression for each column in Hidden tab, but I still have seen an error.

    Could you please help me?

  • What error do you get and what is your expression for the visibility on the column?

    I think you are going to be using the IIF and OR functions for the visibility.  I generally start with one easy to test use case then add in other use cases.  That is, start with ALL (as it is the easiest to set up, test, and it can be copy-pasted between all 4 columns), so if it is set to all you see all 4 columns, if it is set to anything OTHER than ALL, you see no columns.  Next add in Customer (second requirement) and make sure that when you select ALL you see 4, Customer you see 2, and supplier you see none.  Finally, add in Supplier.

    My reasoning behind this approach is it is easy to test 1 use case and verify that it works.  Then you add complexity and make sure it continues to work.  It is very easy for a typo to screw things up and if that typo is copy-pasted to all 4 columns (or worse - only exists in 1 of the 4), the report my not render properly.  Thankfully, SSRS development in Visual Studio is usually really good at telling you where your errors are.

    The above is all just my opinion on what you should do. 
    As with all advice you find on a random internet forum - you shouldn't blindly follow it.  Always test on a test server to see if there is negative side effects before making changes to live!
    I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply