JBirrer
JBirrer

Reputation: 171

SSRS 2016 report or shared dataset has user profile dependencies and cannot be run unattended

I am building an SSRS report that is designed to be flexible so that I don't have to create several copies of the report based on your role in the company. I am using the User!UserID built in parameter to drive one of my report parameters (this filters the top parameter based on your role in our HR system). This part is working great.

However, I also need to be able to schedule this report using a data driven subscription, but since I am using the User!UserID parameter, it is giving me an error that I cannot set up a data driven subscription if there is a user profile dependency. Is there any way around this? I know I can create a standard subscription and it works fine, but with the size of our organization, data driven would be ideal.

Any ideas?

Upvotes: 4

Views: 7166

Answers (1)

JBirrer
JBirrer

Reputation: 171

I was able to find the solution to this with the following article:

https://social.msdn.microsoft.com/Forums/en-US/9c9b650e-d239-4038-8e50-5dd995621c74/how-to-deal-with-useruserid-in-datadriven-subscriptions?forum=sqlreportingservices

"What you can do besides the custom code solution is to create a hidden parameter which will contain the userdID.

Declare that parameter with a default value of the output of the custom code function (Code.UserName()) and thru out the report you use this parameter as replacement for the User!UserID. When scheduling this report you bind this parameter with the output from your subscription query.

In case you haven't got the custom code from the weblog:

Public Function UserName() Try Return Report.User!UserID Catch Return "System" End Try End Function"

Upvotes: 5

Related Questions