从 WPF 打印/报告的最佳方法是什么? [英] What's the best approach to printing/reporting from WPF?

查看:36
本文介绍了从 WPF 打印/报告的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个即将开展的项目,该项目必须能够从其数据中打印简单的报告.它将基于 WPF,我想知道该走哪条路.

I have an upcoming project which will have to be able to print simple reports from its data. It'll be WPF-based, and I'm wondering which way to go.

我知道WPF引入了自己的打印技术(基于XPS),看起来很容易使用.然而,我的一部分人想知道使用 ReportViewer 控件并将其嵌入到 Windows 窗体主机控件中是否会更容易,因为这将使用户能够导出为各种格式以及打印.

I know that WPF introduces its own printing technology (based on XPS) which looks quite easy to use. However, part of me wonders whether it would just be easier to use the ReportViewer control and embed it in a Windows Forms host control, since that will give users the ability to export to a variety of formats as well as print.

有没有人有从 WPF 打印/报告的经验?您会推荐哪个方向?

Has anyone had any experience with printing/reporting from WPF? Which direction would you recommend?

推荐答案

我们遇到了同样的问题,因此暂时使用 RDLC/ReportViewer.没有本机 WPF 报告工具(据我所知),而且 RDLC 使用起来非常简单,而且是免费的.它的运行时开销很小(大约 2Mb),但您必须记住分发它,因为它不是 .NET Framework 的一部分.

We had this same issue, and ended up using RDLC/ReportViewer for now. There's no native WPF reporting tool (that I know of) and RDLC is pretty simple to use, and is free. The runtime overhead for it is small (around 2Mb) but you must remember to distribute it as it isn't part of the .NET Framework.

这篇关于从 WPF 打印/报告的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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