Thursday, February 16, 2012

Change Report Criteria by Username

Hi,

I have a question about passing user information into a report. Right now I have a travel report that accepts trip ID as a parameter. I have multiple users who will access this report through active directory and I think using tripID is too constricting for them. Ideally, I want them to pick their name from a list and pick the travel date(s) that they want to print out.

How can I make the report read in their username from Active Directory and pass this along to the report so that it'll automatically apply a filter the report. Then from a pull-down list, pick the travel date(s) that they're interested. Is this even possible?

Thanks,

Curtis111

Hi Curtis,

You might try using the =User!UserID.Value in the report, pass that as a query parameter, and apply filtering in your database query. This would allow users to see only values based on their userid, and they would not have to select any sort of parameters.

A more secure approach would be to apply filtering in the underlying database based on the users windows credentials. You would set the report data source connection to use windows credentials and then configure the database as noted here:

http://www.microsoft.com/technet/prodtechnol/sql/2005/multisec.mspx

Thanks, Jon

|||

Thanks, Jon. Sounds like the first approach is the simpliest. I'll take easy any day.

Curtis

|||

Can someone provide more detail on how to accomplish the first approach? I am very new to Reporting Services, thanks!

No comments:

Post a Comment