Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


SSRS 2008 User!UserID


SSRS 2008 User!UserID

Author
Message
wendy elizabeth
wendy elizabeth
Mr or Mrs. 500
Mr or Mrs. 500 (587 reputation)Mr or Mrs. 500 (587 reputation)Mr or Mrs. 500 (587 reputation)Mr or Mrs. 500 (587 reputation)Mr or Mrs. 500 (587 reputation)Mr or Mrs. 500 (587 reputation)Mr or Mrs. 500 (587 reputation)Mr or Mrs. 500 (587 reputation)

Group: General Forum Members
Points: 587 Visits: 721
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">
<DataType>String</DataType>
<DefaultValue>
<Values>
<Value>= right(User!UserID,10)</Value>
</Values>
</DefaultValue>
<Prompt>User</Prompt>
<Hidden>true</Hidden>
<ValidValues>
<ParameterValues>
<ParameterValue>
<Value>= right(User!UserID,10)</Value>
<Label>User</Label>
</ParameterValue>
</ValidValues>
</ReportParameter>

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?
happycat59
happycat59
Hall of Fame
Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)Hall of Fame (3.6K reputation)

Group: General Forum Members
Points: 3565 Visits: 3107
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



Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search