我的应用程序中有一个到 SSRS 2010 Web 服务的连接,我可以毫无问题地加载服务器中包含的报表文件夹和报表项目的整个层次结构。我借助 WSDL 工具生成了 SSRS 2010 服务代理,遵循 指南。
我研究了在 WPF 中呈现报表项的不同方法,常见的方法是提供 RDLC 文件的路径作为报表查看器控件的数据源。问题是,当我在内存中加载此层次结构时,我所拥有的只是 CatalogItems,这些项目没有为我提供通向此类对象的路径。
我有点迷失在这里。我怎样才能继续检索可用且可显示的对象?
I have a connection to SSRS 2010 web service in my application and I can load the whole hierarchy of report folders and report items contained in my server without a problem. I generated the SSRS 2010 service proxy thanks to the WSDL tool, following the guideline on MSDN.
I have looked to the different ways of rendering the report items in WPF and the common way of doing so is to provide a path to a RDLC file as a datasource to the report viewer control. The problem is that when I load this hierarchy in memory, all I have is CatalogItems, and these items does not provide me a path leading to such an object.
I am kind of lost here. How can I proceed to retrieve a usable and displayble object?
发布评论
评论(1)
我终于想出了如何做到这一点。
我从 CatalogItem.Path 属性中获取报表路径,然后将 ReportServerUrl 属性添加到 ReportingService2010 实例中,以便稍后检索它。这都是在对象方面。
对于图形,我将 WPF 应用程序中的 Forms ReportViewer 与 WindowsFormsHost 集成在一起。要在控件中显示远程报表,我必须将 ReportViewer.ProcessingMode 更改为ProcessingMode.Remote,最后将 ReportViewer.ServerReport.ReportServerUrl 和 ReportViewer.ServerReport.ReportPath 设置为我的报表对象属性。然后调用ReportViewer.RefreshReport()方法加载报表。
I finally figured out how to do do that.
I take the report path from the CatalogItem.Path property and then I added a ReportServerUrl property to my ReportingService2010 instance so I can retrieve it later. This is all on the object side.
For the graphics I integrated the Forms ReportViewer in my WPF application with the WindowsFormsHost. To display the remote report in the control I had to change the ReportViewer.ProcessingMode to ProcessingMode.Remote and finally set the ReportViewer.ServerReport.ReportServerUrl and ReportViewer.ServerReport.ReportPath to my report object properties. Then call the ReportViewer.RefreshReport() method to load the report.