在 WPF 中使用 MS ReportViewer [英] Using MS ReportViewer in WPF

查看:44
本文介绍了在 WPF 中使用 MS ReportViewer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将通过将 ReportViewer 放置在 WindowsFormsHost 中,开始在 WPF 应用程序中使用 MS ReportViewer.

I'm about to start using the MS ReportViewer in a WPF application by placing the ReportViewer in a WindowsFormsHost.

这是正确的方法吗?由于您无法在设计时在 WindowsFormsHost 中使用 ReportViewer,因此设计报告的最佳方法是什么.

Is this the correct approach? What is the best way of designing the reports as you cannot use the ReportViewer at design time in a WindowsFormsHost.

最好在 SQL Server 中创建 RDL 报告,然后将其转换为 RDLC,或者创建一个新的 Winforms 应用程序以在 WinForms 框架中创建一个 RDLC 文件,然后将其复制到 WPF 应用程序.

Is it best to create an RDL report in SQL Server and then convert it to an RDLC or maybe to create a new Winforms app to create an RDLC file in a WinForms framework and then copy it to the WPF app.

我需要通过下拉列表过滤报告,因此也需要考虑这一方面.如果有人已经在 WPF 中使用 ReportViewer,我将不胜感激关于最佳方法的一些反馈......非常感谢.

I will need to filter the reports via dropdowns so there's that aspect to consider too. If anyone out there is already using ReportViewer in WPF I would appreciate some feedback on the best approach.....Many thanks.

推荐答案

我们在使用 WindowsFormsHost 时确实取得了成功.我没有参与创建 RDLC 文件本身,但我相信它们是在 WinForms 项目中设计的(如您所说),然后复制过来.

We've definitely had success just using the WindowsFormsHost. I haven't been involved in creating the RDLC files themselves, but I believe they were designed (as you say) in a WinForms project and then copied across.

请注意,如果您不需要本地报告,您可以使用 WPF Frame 控件并将其指向基于服务器的报告的 URL(它像 Web 浏览器一样呈现它).这对我们也非常有效.

Note that if you don't need local reports you can use a WPF Frame control and point it at the URL of the server-based report (it renders it like a web browser would). This works really well for us too.

这篇关于在 WPF 中使用 MS ReportViewer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆