Using Current User Name in Report Builder Filter

If I create a report in Report Builder that shows some data connected with usernames (e.g. work items assigned to my team members), how can I filter the report data by the current user In Team Queries I do this by specifying @me but it seems it does not work with Reporting Services...

Answer this question

Using Current User Name in Report Builder Filter

  • JessicaM

    In Report Builder, GETUSERID() will return the current user.

    Bob Meyers has a new blog entry with all sorts of good stuff around these sorts of questions:

    http://blogs.msdn.com/bobmeyers/articles/Implementing_Data_Security_in_a_Report_Model.aspx


  • Np4120

    We don't expose the account that RS uses to issue report model queries against SQL Server.

    What is it that you're trying to achieve

    Thanks

    Tudor Trufinescu



  • Yuval Ronen

    Anyone know if a way to get the SQL authenticated userid rather than the NT autenticated id

  • DaveTrux

    Thanks however. I did solve the problem by adding a new computed field to my TFSWarehouse.dbo.Work Item table (the field gets the domain user name from TFSWarehouse.dbo.Person table), reflecting it in the appropriate semantic model and then using in my report filtered by a user name.
  • Gillissie

    There's nothing "in the box" that returns the user identity in the format you want. You'll probably have to write some code in a custom assembly to query this info from AD using domain\username as in input, or have some sort of lookup table which maps domain\username to "full name"
  • chisanga

    Thank you for GETUSERID() function and for the link but... GETUSERID() returns the current user in the form of MYDOMAIN\jsmith while my custom field (e.g. Developer defined in my project template with <VALIDUSER group="[Project]\Developers"/> parameter) stores full user names (e.g. John Smith) - how can I solve this problem Thanks in advance.
  • Using Current User Name in Report Builder Filter