简体   繁体   中英

Simple SQL Reporting Services Question

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?

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;

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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM