November 29, 2016 at 10:54 am
In an SSRS 2008, I found that I can use the following value 'right(User!UserID,10)' as a parameter value to obtain the userid of the person running the ssrs 2008 report. However I would like to know where this userid comes from? is this from windows authentication?
Also I would like to know if there are other ways to obtain the userid for the person running the report? Would you tell me and/or point me to link(s) that will tell me how to obtain the userid from other methods?
November 29, 2016 at 11:34 am
Sorry, but I beg to differ on your formula... How about
=Right(User!UserID,InStr(User!UserID,"\",CompareMethod.Text)-1)
I'm not sure where you got the value of 10 from... maybe the length of your servername?
As to where the userID comes from, I guess it depends on how your credentials are set up.
November 29, 2016 at 9:07 pm
Would you explain your formula to me?
November 29, 2016 at 9:42 pm
I modified the code to make sure it would work... so this is a little different than the last version. Should work with strings of any length as long as there's only one \.
<taking a giant step backward>
=Right(ReportItems!txtComputerNameUserID.Value,
Len(ReportItems!txtComputerNameUserID.Value) - InStr(ReportItems!txtComputerNameUserID.Value,"\",Microsoft.VisualBasic.CompareMethod.Text)
)
Len(ReportItems!txtComputerNameUserID.Value)
--- returns the length of the String.
InStr(ReportItems!txtComputerNameUserID.Value,"\",Microsoft.VisualBasic.CompareMethod.Text)
-- returns the ordinal position of the "\" in the string.
Subtracting the two leaves the length of the string after the
So the RIGHT(string, length) part returns the part of the string to the right of the \.
Does that make sense?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply