Passing Parametrs from SSRS Report to C# program

Kharl Levinn 1 Reputation point
2022-09-28T06:21:28.917+00:00

I have a C# project and I'm using SSRS as my reporting tool. I want to show in the footer of my report the Full name of the user who is currently logged in to the system.

For example: if "User1" logged in and created a report, User1's full name will be displayed in the footer.

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,827 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Joyzhao-MSFT 15,566 Reputation points
    2022-09-28T08:08:08.727+00:00

    Hi @Kharl Levinn ,
    SSRS does not recognize a user's full name, you can use the built-in field =User!UserID to return the ID of the user running the report.

    If you are using Windows Authentication, this value is the domain account of the current user. The value is determined by the Reporting Services security extension, which can use Windows Authentication or custom authentication.

    Suppose that your account is like domain\LoginName, so if your domain account does not contain first and last name, the first name and last names will not be displayed.
    Best Regards,
    Joy


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. AniyaTang-MSFT 12,331 Reputation points Microsoft Vendor
    2022-09-28T09:12:08.127+00:00

    Hi @Kharl Levinn
    I found a link for you: https://www.youtube.com/watch?v=PNR5Zbh4QcA. This video shows how to pass parameters to reports in C#.
    Since I'm not very familiar with programming in c#, I can't test it for you. If you want to ask detailed c code, maybe you can go to the c# community for help: dotnet-csharp.html.
    Hope this can help you.
    Best regards,
    Aniya