views:

34

answers:

1

I'm trying to enumerate, in c#, the reports for a user on reporting services.

How do I do this? Is there a web services call I should use, or should I just get the html returned from http://localhost/ReportServer/lists.asmx and pull that apart?

The second option sounds like a bit of a hack. Surely theres a better way?

+2  A: 

SSRS has a full SOAP API, you can see info on that here: http://technet.microsoft.com/en-us/library/ms155376.aspx

From the above article:

   // Create a Web service proxy object and set credentials
   ReportingService2005 rs = new ReportingService2005();
   rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

   // Return a list of catalog items in the report server database
   CatalogItem[] items = rs.ListChildren("/", true);

   // For each report, display the path of the report in a Listbox
   foreach(CatalogItem ci in items)
   {
      if (ci.Type == ItemTypeEnum.Report)
         catalogListBox.Items.Add(ci.Path);
   }

There's a full tutorial there too: http://technet.microsoft.com/en-us/library/ms169926.aspx

Glenn Slaven
Cool. So, how do I get a reference to ReportServices? Do I have to specify a reportservices instance at compile time? (Sorry, I'm a bit of a noob at this)
WOPR
I just added a link to the full tutorial on the technet site, that should give you a good intro on how to get going with it
Glenn Slaven
Nice, tick for you!
WOPR