Sunday, September 1, 2013

SSRS Strip Domain from User!UserID

In SSRS, if you want to be fancy and display the USER NAME in the header or footer of your reports, like what I do.  SSRS uses Domain\UserName format... So someone this morning was asking in the forums about how to strip the domain out.

So I provided two solutions...


="Welcome " & MID(User!UserID,InStr(User!UserID,"\")+1, Len(User!UserID))

="Welcome " & =right(User!UserID, InStr(StrReverse(User!UserID),"\")-1)

Hope that helps someone...