Reputation: 1
In SSRS how can we switch shared data sources based on condition.
I do have two shared data sources and one should be used when user access with admin access and other data sources should come into picture when user with other roles are using.
Can you guys help me with it?
Upvotes: 0
Views: 310
Reputation: 14108
You can create a new datasource setting a conditional connection string in the DataSource properties based on User!UserID
running the report.
Use something like this:
=IIF(User!UserID = "YOURDOMAIN\Admin1",
"Data Source=MSSQLDB;Initial Catalog=DataBaseForAdmin",
"Data Source=MSSQLDB;Initial Catalog=DataBaseForNonAdmin"
)
Let me know if this helps.
Upvotes: 1