简体   繁体   中英

Get Sql Server Reporting Services report description in code

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?

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

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