views:

99

answers:

3

I'm just writing up a feasibility study for a project and before I go in too deep, can I get a .net program to get a list of reports for a server in SQL Reporting Services?

In other words, if someone adds a new report, we want it to show in the list. Also, can you get information in detail about the report via some sort of enumeration?

+1  A: 

Reporting Services has a SOAP API, so you can retrieve lists of reports via that, but I think it'd be easier to go directly to the database. The Catalog table in the ReportServer database contains a list of every report. You can even link from there to the ExecutionLog table to find out when it was run (although that table seems to be a sliding window of about three months - you won't get execution details older than that).

Matt Hamilton
+3  A: 

You can access all this data via the Reporting Services Web Service. You'll have to create a proxy object first but once that is done, getting a list of reports is simple. For example:

ReportingService2005 service = new ReportingService2005();
service.Url = ConfigurationManager.AppSettings["ReportingServicesURL"];
service.UseDefaultCredentials = true;
CatalogItem[] items = service.ListChildren(reportingServicesfolderPath, false);
List<string> reports = new List<string>(items.Length);
foreach (var item in items)
{
    reports.Add(item.Name);
}
return reports;
TskTsk
A: 

I suggest you read up Integrating Reporting Services into Applications. After all the Reporting Service is a WebService endpoint, so you can use SOAP WebService endpoints or HTTP calls. Besides that there is the Reporting Services Class library and last there is the Reporting Services WMI Provider. Afaik each of the above libraries allow you to do what you asked.

Remus Rusanu