Suresh Kandi
Suresh Kandi

Reputation: 1

Switching shared data sources based on condition in SSRS

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

Answers (1)

alejandro zuleta
alejandro zuleta

Reputation: 14108

You can create a new datasource setting a conditional connection string in the DataSource properties based on User!UserID running the report.

enter image description here

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

Related Questions