Question

I am trying to create a data driven subscription for a report that uses @UserID to filter the results (for security purposes). The solution I've seen referenced as the answer to several similar questions is a broken link.

We'd like to have a version that a user can access online as well as the subscription report that is emailed. Is there any way to do this without having two versions of the report (one with userID and one without)?

Was it helpful?

Solution

We have developed a solution that allows the same report to be used for live access as well as data-driven subscriptions (DDS). It is based on the concept found at the link provided by djphatic

To start, we return the @User value using custom code added to the report, instead of the User!UserID function which will make the DDS choke. The code is similar to the Prologika solution, but I found it at another online source--my apologies for not remembering where I found it. The code is:

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

For the user parameter default value we use:

=Code.GetHashedUser()

This returns the User!UserID if the report is being run live.

The data-driven subscription needs to have the user and other parameters passed using the query for the subscription. Since any parameters passed this way will be visible in the URL, we use a hashed version of the userID (called the userkey). The userkey corresponds to a value in our security table and can identify the user and their associated permissions. We don't encrypt the other filters, since they are based on the user and are used for drill-downs.

OTHER TIPS

Please see the link below. I've not tested this myself but I've seen this solution mentioned before.

http://prologika.com/CS/blogs/blog/archive/2011/03/28/data-driven-subscriptions-and-row-level-security.aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top