Question: How to know the user name in the code of the report?

Answer:

The variable AUTHLOGIN always contains the current user name.