Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

SSRS 2008 User!UserID Expand / Collapse
Posted Friday, October 4, 2013 10:04 AM


Group: General Forum Members
Last Login: Friday, February 5, 2016 1:59 PM
Points: 481, Visits: 573
In a SSRS 2008 report, I see some sql that is accessing User!UserID as a hidden parameter that is supplied to the SSRS report as displayed in the
XML listed below:
<ReportParameter Name="User">
<Value>= right(User!UserID,10)</Value>
<Value>= right(User!UserID,10)</Value>

This value is not coming from any sql that is run in the SSRS report. I am assuming this is some kind of a feature in SSRS 2008, correct?

Thus can you explain to me where the value for the User!UserID is coming from? In addition, would you tell me what the
"right(User!UserID,10)" statement is actually doing?
Post #1501663
Posted Monday, October 7, 2013 9:26 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 8:24 PM
Points: 3,412, Visits: 2,929
User!UserID is a standard fields available within a report. Reporting services gets the value from Windows. It contains the windows/AD user name of the user who is running the report. So, if you domain name is "mycompany" and you login as user "myuser" then the value of User!UserID will be "mycompany\myuser"

right(User!UserID,10)" gives you that last 10 characters of the variable User!UserID. In my example, this would be "any\myuser". I suspect that you company has user names that are 10 characters long and the "RIGHT" function for you would be returning the person's user name

Post #1502458
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse