Get Sql Server Reporting Services report description in code

风流意气都作罢 提交于 2019-12-11 18:21:57

问题


I have an ASP.NET web page with a ReportViewer control that dynamically loads a report based on the URL and I want to set the DisplayName for the report from code as well. This name is used as the suggested file name whenever someone exports the report to a file.

Now I'd like to use the report description (which is baked in the report file when it's deployed on Reporting Services) for that name but I don't find a way to retrieve that (other than parsing the XML. I guess this should be possible through the ReportViewer control as well.

Ultimately I could also use the value from a TextBox (generated by an expression) in the report (if I rename it consistently over all reports).

Anyone knows how to get either of those values?


回答1:


It's a property of the catalog item from the SSRS web service endpoint. You'll need to add a web reference to the ReportService2010 wsdl, and then you'll be able to get a list of CatalogItems. Each of those will have a Description property. Note that this can only be set programatically or via the SSRS management interface, it can't be set in BIDS.

http://msdn.microsoft.com/en-us/library/reportservice2010.catalogitem.description



来源:https://stackoverflow.com/questions/9533630/get-sql-server-reporting-services-report-description-in-code

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