Example of using SSRS SOAP API

This example uses adventure works sample  database and reports, please refer to books on line for setup instructions.

1.       Open Visual Studio and create a console application (VB or C#)

2.       Replace the code in Module.vb or Module.cs with the appropriate code snippet

a.       C#

using System;

using SoapAPI.ReportService2005;

 

class Module1

{

 

         public void Main()

         {

                 ReportingService2005 rs = new ReportingService2005();

                 rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

 

                 rs.Url = "http://Localhost/reportserver/reportservice2005.asmx";

 

                 Property name = new Property();

                 name.Name = "Name";

 

                 Property description = new Property();

                 description.Name = "Description";

 

                 Property[] properties = new Property[2];

                 properties(0) = name;

                 properties(1) = description;

                 try {

                          Property[] returnProperties = rs.GetProperties("/AdventureWorks Sample Reports/Company Sales", properties);

                          Property p;

                          foreach ( p in returnProperties) {

                                   Console.WriteLine((p.Name + ": " + p.Value));

                          }

                 }

 

                 catch (Exception e) {

                          Console.WriteLine(e.Message);

                 }

                 finally {

                          Console.ReadLine();

                 }

         }

 

}

b.      VB

Imports System

Imports SoapAPI.ReportService2005

 

Module Module1

 

    Sub Main()

        Dim rs As New ReportingService2005

        rs.Credentials = System.Net.CredentialCache.DefaultCredentials

 

        rs.Url = "http://Localhost/reportserver/reportservice2005.asmx"

 

        Dim name As New [Property]

        name.Name = "Name"

 

        Dim description As New [Property]

        description.Name = "Description"

 

        Dim properties(1) As [Property]

        properties(0) = name

        properties(1) = description

        Try

            Dim returnProperties As [Property]() = rs.GetProperties("/AdventureWorks Sample Reports/Company Sales", properties)

            Dim p As [Property]

            For Each p In returnProperties

                Console.WriteLine((p.Name + ": " + p.Value))

            Next p

 

        Catch e As Exception

            Console.WriteLine(e.Message)

        Finally

            Console.ReadLine()

        End Try

    End Sub

 

End Module

3.       Run the application

Comments

# wow gold
Gravatar A localwow gold museum closed its doors eleven months ago for a renovation.
Left by rain1000 on 11/19/2008 10:33 PM
# re: Example of using SSRS SOAP API
Gravatar It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of

post. I will be your loyal reader. Thanks again.


:)
Left by tiffany on 7/12/2009 8:04 PM

Leave Your Comment

Title*
Name*
Email (never displayed)
 (will show your gravatar)
Url
Comment*

 

Preview Your Comment.