If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

How to render objects in a report based on user session

Started by mlodugu1, 10 Apr 2016 11:53:30 AM

Previous topic - Next topic

mlodugu1

Hi,

Please let me know how I can render data objects in a report in report studio based on user session.

For eg, I have a list and a crosstab in a report. I would like to allow user A access to the List only when he logs in and runs the report, allow user B to access the crosstab only when he runs the report, similarly user X should be able to log in to both the List and the Crosstab and so on ........

How can I do this?


Regards

HalfBloodPrince

you are using same query for list and crosstab or different ?

afzaki7

" إِذَا مَاتَ ابْنُ آدَمَ انْقَطَعَ عَمَلُهُ إِلا مِنْ ثَلاثٍ : مِنْ صَدَقَةٍ جَارِيَةٍ ، أَوْ عِلْمٍ يُنْتَفَعُ بِهِ ، أَوْ وَلَدٍ صَالِحٍ يَدْعُو لَهُ "

mlodugu1

Hi,

I am using the same query for the list and crosstab.

for ex:      Year, Product Line, Quantity, Revenue

some users should be able to access only the list, others only the crosstab and some should be able to access both the objects. A condition is required that dynamically provides access to the user when he runs the report.  :)

bdbits

How would you decide which user sees which objects? Is there something in your database or authentication source that would determine this?

HalfBloodPrince

Assuming that you have same query for both list and Cross tab.

create below calculation name it as user. It will capture the user name who is running the report and make the groups based on requirement like U1 see list ,U2 see crosstab and All will see both.
if(#sq($account.defaultName)#='XXXXXX') then
('U1')
else
if(#sq($account.defaultName)#='YYYYYY') then
('U2')
else
('All')

then create a string variable as
if([Query1].[User]='U1') then
('U1')
else
if([Query1].[User]='U2') then
('U2')
else
('All')

Add column user in both List and Crosstab. And in render variable property select string variable.
set U1 and ALL check box for List and U2 and All check box for Crosstab. (Refer Conditional rendering in Cognos for more details)

Then see you are getting desired result. You can set box type to None for user column after that.

dys

It might be better to use the session parameter $account.personalInfo.userName since it will be unique within your authentication protocol, whereas $account.defaultName may not be unique.

mlodugu1

It works!. Thank you very much half blood prince.
Thank you Dys for your suggestion.  :)