COGNOiSe.com - The IBM Cognos Community

IBM Cognos 8 Platform => COGNOS 8 => Report Studio => Topic started by: Kutti on 03 Jan 2011 10:47:31 PM

Title: Filter prompt values based on user
Post by: Kutti on 03 Jan 2011 10:47:31 PM
Hi All,

Need urgent help.

I need to implement data level secuirty in my report. I have a Prompt in a prompt page which holds different category names (A, B, C) and those categoty names shoule be displayed based on the user who runs the report.

If User A runs the report then category A should be displayed in the prompt.
I am trying to use  #sq($account.personalInfo.userName)# session parameter to filter the data but not sure how to check the user name with that parameter.

I donot have any data about the users in my DB tables. We are using Access manager as Authentication.

do i need to have a table with all the usernames in my DB to implement security. We also have Active directory.  I  also tried to create a filter on the prompt in Report studio  to filter the data but got "Parsing  text error". If am running the report and my username is 'User A' then how to get below logic work

IF
#sq($account.personalInfo.userName)#='UserA'
THEN
([Layer].
.[Category])='A'


Please help me to get this implemented.

thanks


Title: Re: Filter prompt values based on user
Post by: PRIT AMRIT on 03 Jan 2011 11:20:55 PM
another easy way is, you may have 3 prompts A, B, C on your prompt page.

Create a string variable #sq($account.personalInfo.userName)#

Value: User A, User B, User C.

Then just show/hide the prompts based on the Users.
---------------------------------------------------------
Or, create a Data Item where your prompt point to and write a case/if..else statement

If (#sq($account.personalInfo.userName)# ='User A'
then ('A')
else ('B')

Hope this would work for you.

Thanks
P