SSRS 2008 User!UserID

  • 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?

  • 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

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply