Quantcast
Channel: SQLServerCentral » Reporting Services » Reporting Services » Latest topics
Viewing all articles
Browse latest Browse all 2791

Howto: Determine subscription creator at run time of the subscription?

$
0
0
To filter data, I am using User!UserID as a hidden parameter, so is passed into my stored proc's so can use it to restrict which records are returned. For example, user A can only see UK data, user B can just see FR data, but we have a geographic hierarchy, such as EMEA/LATAM/APAC etc. and the use can choose at any level, so if only can see UK, then they could choose EMEA, but when it runs they will just get UK. This allows for if/when then need to see FR as well, then nothing needs to change in the report, as EMEA was chosen, it will naturally fall throughThe problem I have got is if the user sets up a subscription, then when it runs, User!UserID will be the service account, which will have full permission and not the actual user who setup the subscription.I can use RenderFormat.IsInteractive to determine that this is a subscription but then I need to query the subscription table to find the owner, and pass that to my procedure instead of the service account.If more than 1 person has a subscription to this report, how do I at run time, determine which subscription is running so I can get and use the correct owner of this instance of this report running.This is SQL 2014, using Report Manager.Thanks in advance.

Viewing all articles
Browse latest Browse all 2791

Trending Articles