locked
How to get right value of global @UserId parameter for SSRS reports RRS feed

  • Question

  • User-1183675850 posted

    Hi,

    I have a 2012 asp.net web application and one of an aspx web for page contains an aspx.net report viewer control.  That report viewer control will work with remote SQL Server 2012 SSRS reports.

    Each user will login the web application and will have a user identity (user name) as .net forms authentication gives to him or her.  However, on SSRS reports, the global @UserId parameter is shown with a value that differs from real web user name I expect.   Instead, the value of @UserId is shown as "IIS APPPOOL\<my web application IIS pool name>", and this issue happens regardless of who logs in my web site.

    How can I set/code the @UserId parameter from my aspx page code behind so it will show correct user-login names (got from asp.net Forms Authentication Cookie) on SSRS reports?

    Thank you in advance.

    Wednesday, July 3, 2013 12:02 PM

Answers

  • User551462331 posted

    the userid from form authentication can be passed to SSRS report as a parameter (like other report parameters)

    then, u will have to make changes in SSRS report to use report parameter instead of global parameter for userid field

    u can pass parameter to SSRS report through query string... check this

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

    hope this helps...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 3, 2013 2:06 PM

All replies

  • User551462331 posted

    the userid from form authentication can be passed to SSRS report as a parameter (like other report parameters)

    then, u will have to make changes in SSRS report to use report parameter instead of global parameter for userid field

    u can pass parameter to SSRS report through query string... check this

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

    hope this helps...

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, July 3, 2013 2:06 PM
  • User-1183675850 posted

    Thank you for your reply.

    If I pass that userId parameter to ssrs report through query string, then on ssrs rdl reports, then how can such reports consume/extract/parse that passed parameter?  Is there built-in function in rdl reports to do query string parse?

    Thursday, July 4, 2013 8:56 AM
  • User551462331 posted

    how can such reports consume/extract/parse that passed parameter?  Is there built-in function in rdl reports to do query string parse?

    once u deploy report to server... and access direct report link via browser, u will see the parameter filter where, u can enter the value and geenrate report....

    once u click on generate report button, u can note that it invokes the report by passing filter values in querystring... that means, deployed SSRS reports already manage report parameter via querystring values....

    u can pass same querystring key through u r application to pass the parameter values

    hope this helps...

    Thursday, July 4, 2013 11:52 AM
  • User-1225287840 posted

    Have a look at this link.

    Passing UserId via querystring:
    http://modulemasters.com/SupportForums/tabid/255/forumid/1/postid/416/view/topic/Default.aspx

    Thursday, July 4, 2013 12:34 PM