Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 Determining UserID in a dataset

Author  Topic 

bmtndog2
Starting Member

3 Posts

Posted - 2005-11-04 : 15:18:00
I am trying to populate a dropdown report parameter list based on a user id and department. Basically certain departments should only see certain dropdown selections.

So in a dataset I determine the user id and department via the following sql:

select @dept=department from USER_BASE where USER_ID = system_user

Then based on the department I run the following sql to get dropdown values:

select SITE_CODE, SITE_CODE_DESC from tbl_site_list
where department = @dept

This works fine while in visual studio, however after I deploy the report and run it in Report Manager it doesn't work cause it uses the id of the datasource, not the user who is running the report.

I have tried to use the global parameter User!UserID in a dataset but the dataset never compiles, it errs out.

Any suggestions?

Thanx.

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2005-11-04 : 17:03:37
If you are going to let the interface handle all security and pipe data requests through a single login, then your application and your sprocs will need to exchange an additional USERID parameter.
Go to Top of Page

bmtndog2
Starting Member

3 Posts

Posted - 2005-11-07 : 07:51:18
quote:
Originally posted by blindman

If you are going to let the interface handle all security and pipe data requests through a single login, then your application and your sprocs will need to exchange an additional USERID parameter.

Go to Top of Page

bmtndog2
Starting Member

3 Posts

Posted - 2005-11-07 : 07:53:03
That's what I have been trying to figure out how to do but have not come up with anything yet. Do you have a suggestion?

Thanx.
Go to Top of Page

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2005-11-07 : 09:50:14
Like I said, add a UserID parameter to your application procedures and use it in your sprocs to filter the results.
Go to Top of Page
   

- Advertisement -