views:

1393

answers:

1

I have a report with a parameter that is populated by a list of sales representatives returned by a query. I want to filter that list based on security rights of the user running the report.

In order to make the query work I need to pass the user!userID to the db. I tried something like this:

...where UserName = user!UserID...

But it doesn't like the syntax.

+2  A: 

Change your query to:

where UserName = @user

... and in the "Parameters" tab, assign "User!UserID" to the "@user" parameter.

Matt Hamilton
When I try that I get the following error. The report parameter 'UserName' has a DefaultValue or a ValidValue that depends on the report parameter "user". Forward dependencies are not valid.
Jeff
Really? I do exactly what I describe here in a couple of my own reports. Are you doing anything other than the steps described above?
Matt Hamilton
Finally figured it out. Moved the "user" parameter up the list so it is above my "UserName" parameter. That way it's in memory when the dataset for "userName" is being populated. Thanks for the assurance that this would work. I really appreciate the help.
Jeff
Oh, you had a "UserName" parameter as well? Glad I could help anyway.
Matt Hamilton