How do you retrieve Windows XP user id after .rdl uploaded to sql report server

Posted on 2009-05-01
Last Modified: 2012-08-13
Using Sql 2005   VS 2005  to create this Report.

I created a ssrs report. In the report is a dropdown. Depending on the Windows user id, I will default something in the Dropdown box. The stored procedure that is used to create the dropdown retrieves the windows user id with no problems (on my desktop).
Once I upload the .rdl to the sql Report Server, the user id is now the generic id assigned to that report server. Once on the report server, I need to access the original Windows user id not the sql report server id.

** The users Pin# is part of the Windows User Id. I need this pin#

Can this be done?  Everything I read say No.
Question by:thayduck
    LVL 9

    Expert Comment

    When you create your datasource you can specify that the connection should use Integrated Security and will use the credentials of the user that runs the reports.

    If that is not what you are looking for, you can run the report through a report viewer control in a custom web application (an .aspx file) and pass the username as a parameter to the report.  If you want an example of that let me know.

    Author Comment

    Do have Intergrated Security Checked. Not sure how you tell datasource to use the credentials of the user that runs the reports.

    This report is part of a bigger system (many reports) out of my control, so a report viewer control is not in the cards.
    LVL 9

    Expert Comment

    AFAIK, There is no way you can do this using only the rdl file.  At a minimum you would need to modify the Reporting Server ReportViewer.aspx page to have it pass the username to the report.  But, if you can't even modify that - then I think you are out of luck.

    Accepted Solution

    I found answer to my problem here and it worked for me.
    I created a dataset within my ssrs report that will call Stored procdeure  SP123. The dataset will pass a parm to SP123 called parm123 with a value of  =User!UserID (from Global parms).
    Now when I access that report from the remote report server, I am accessing the Users Windows Userid not the remote server ID when building my dropdown (using that dataset).

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    This video discusses moving either the default database or any database to a new volume.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now