- With the report open in Report Studio, click on Query Explorer and select the query to be conditionally displayed.
- 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
- Set the expression of the new data item to: #sq($account.defaultName)#
- Click on the Conditional Explorer and select Variables
- Add a new Boolean variable (called user_name) with the expression: [User]='user_name'
- From Page Explorer, select the appropriate report page
- Highlight the data item in the column to be conditionally displayed
- From the Properties pane to the bottom right corner of Report Studio, locate General > Conditional Style
- Click on the Ellipses and select the conditional variable (user_name).
- 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].
- From the Properties pane, locate Box > Box Type then click on the down arrow and select None].
- Repeat step 7-11 for the column label.
- Double click on the conditional Explorer to unselect it.
- 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.
Tuesday, January 31, 2017
Conditionally display a column in Report Studio based on User ID
Labels:
Cognos Tips
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment