Wednesday, 28 June 2017

Displaying report columns only when a user chooses to view them


Hello, are you trying to create a report where a user can choose to view certain columns but things ain't working as you expect? Don't worry you are safe. Here is what you need to do.

  • First create a global variable of type boolean to control when the column will appear on the report
  • Add the variable to the report request page. This enables the user to check and uncheck thus choosing whether to display column or not.
  • Add the variable to the report dataset so it is accessible in report layout in Visual Studio or Report Builder.
  • Select a column whose visibility you want to change based on user selection. Right click the column and select "Column Visibility". 
  • Change visibility based on an expression. for example =iif((Fields!ShowBilltoNo.Value=True),False,True). That expression will only display "Bill to No" column on the report when the user ticks the "showBilltoNo" field on the report request page. It's that simple, now do it and punch the air when stuff works. Good day


1 comment:

  1. Please leave a comment to let me know if this article was useful. Thanks and best regards

    ReplyDelete