SSRS get meta data of remote report

喜夏-厌秋 提交于 2019-12-24 01:08:42

问题


How can I retrieve the meta data such as Description, Modified/Create Dates etc from a Remote SSRS report. The report itself displays no problems in the ReportViewer control on the aspx page so I can access the report...

there doesn't seem to be any properties for those values in the .ServerReport object...

thanks heaps!


回答1:


There are a couple of ways, one way is to add a web reference to the web services interface of your reporting server and call the GetReportDefinition method. more information here:

http://msdn.microsoft.com/en-us/library/aa258101(SQL.80).aspx

The code could look like this:


ReportingService reportingService = new ReportingService();

XmlDocument xmlDocument = null;

byte[] reportDefinition = reportingService.GetReportDefinition(ReportName);

using (MemoryStream memoryStream = new MemoryStream(reportDefinition))
{
    xmlDocument = new XmlDocument();
    xmlDocument.Load(memoryStream);
}

This gets your .rdl file that you can parse using the XML tools. You can also call the tables in the SSRS database via SQL/ADO/Linq to get the information you are after:

Some good examples of T-SQL against the reporting service database:

http://www.purplefrogsystems.com/blog/?p=13

All of the information you are after might not be in a single spot, for example, some might be in the .rdl, and some in the SQL Server database.

{6230289B-5BEE-409e-932A-2F01FA407A92}



来源:https://stackoverflow.com/questions/818714/ssrs-get-meta-data-of-remote-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!