3
votes

I am getting the following error while trying to create a data driven subcription for a report:

Data driven subscriptions cannot be createdbecause the credentials used to run the report are not stored,the report is using user-defined parameters values, or if a linked report, the link is no longer valid.

Error Screenshot

As it is given, there might be three things which causes this problem. In my report:

  • the credentials are saved (stored)
  • the reports have some integer and date parameters which are hidden
  • the report does not have a linked report

So, my doubt is: do I get this error because of the parameters? If so, what is the solution?

2

2 Answers

4
votes

The problem is because of the user id expression used in the report. The solution is to have the following code in the Report Properties-> Code

Public Function UserName() Try Return Report.User!UserID Catch Return "ind\injj" End Try End Function

call this function in the user id text box as code.UserName()

now the exception is solved and the subscription can be done. instead of hardcoding the user name in catch, u can even give the code for that..

thanks to http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/cb4e7816-d421-4921-a4e5-b258888748f9/

http://msdn.microsoft.com/en-us/library/ms156012.aspx

0
votes

Just ran into a similar issue. Under report properties -> Language I found the value of "=User!Language". I was able to remove this setting and could then create a data driven subscription.