Tuesday, January 31, 2017

Conditionally display a column in Report Studio based on User ID



  1. With the report open in Report Studio, click on Query Explorer and select the query to be conditionally displayed.
  2. Ensure the Toolbox tab is selected on the Insertable Objects pane, then drag and drop a new Data Item (called user) under the Facts column
  3. Set the expression of the new data item to: #sq($account.defaultName)#
  4. Click on the Conditional Explorer and select Variables
  5. Add a new Boolean variable (called user_name) with the expression: [User]='user_name'
  6. From Page Explorer, select the appropriate report page
  7. Highlight the data item in the column to be conditionally displayed
  8. From the Properties pane to the bottom right corner of Report Studio, locate General > Conditional Style
  9. Click on the Ellipses and select the conditional variable (user_name).
  10. From the Conditional Explorer, go to the Variable > user_name > Yes. [If a user logs in as user_name, the object being conditionally displayed is not visible].
  11. From the Properties pane, locate Box > Box Type then click on the down arrow and select None].
  12. Repeat step 7-11 for the column label.
  13. Double click on the conditional Explorer to unselect it.
  14. Save the report, log out and log on as user_name to test. When the column is hidden, it will not appear in HTML, Excel or PDF formats.

No comments:

Post a Comment