I'm using .NET ReportViewer control.
We only want to display the "Dealer" dropdown if user is admin.
Is it possible to hide the "Dealer" dropdown control based on another parameter passed in, like IsAdmin?
I'm using .NET ReportViewer control.
We only want to display the "Dealer" dropdown if user is admin.
Is it possible to hide the "Dealer" dropdown control based on another parameter passed in, like IsAdmin?
The
Hidden
property of a parameter can only beTrue
orFalse
so you can't have an expression that changes the visibility dynamically.However, what you could do is make the
@Dealer
parameter's available values restrict choice based on the logged in user. For example, let's assume that each user belongs to a dealer but administrators can see all dealers. Make the SQL for the@Dealer
parameter's available values be something like:Now the parameter will show all dealers when the user is Admin but only the specific dealer for that user when they are not. Default the parameter to the user's dealer and you are good to go.
@UserId is a global parameter for the currently logged in user.