Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I am trying to return a list of Reports from our SSRS Reporting server using C# and Visual Studio 2022.

I have seen many examples on the internet on how to achieve this but non of then work (they are all basically the same).

I have even tried examples form Chat-GPT with no luck.

What I have tried:

I have created a connected service to our Reporting Server and this has generated as Reference Class to use (ReportingService2010Soap).

From here it has been trial and error as nothing I've seen sems to fit the model shown in the examples.

This is some of the code I have tried with no luck..
C#
public static ReportingService2010SoapClient.EndpointConfiguration ReportingService2010Soap { get; set; }

        static void Main(string[] args)
        {
            //Console.WriteLine("Hello World!");

            // Reporting Services URL
            var reportServerUrl = "http://<Reporting ServerName & Port>/<RootFolder>/ReportService2010.asmx";

            // Report Server credentials
            var credentials = new NetworkCredential("<Domain UserName>", "<Domain Password>", "<Domain Name>");

            try
            {
                // Create an instance of the Reporting Services web service client
                ReportingService2010SoapClient client = new ReportingService2010SoapClient(ReportingService2010Soap, reportServerUrl);

                 client.Endpoint.Address = new System.ServiceModel.EndpointAddress(reportServerUrl);
                // Set the credentials
                client.ClientCredentials.Windows.ClientCredential = credentials;

//Comes unstuck here, I cannot get the list of reports, nothing I've tried works, need help from here on...




      Console.ReadLine();
 }


Hopefully someone can assist with an example that works, or documentation that is correct for VS2022 and Connected Service References.

Regards
Peter.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900