WPF:打印分页数据网格的最佳方法 [英] WPF: Best method for printing paginated datagrids

查看:24
本文介绍了WPF:打印分页数据网格的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

天啊,我接受了调查这个问题的教育吗?我想我已经被 Powerbuilder 宠坏了,它具有开箱即用的出色功能.

Boy did I get an education looking into this. I guess I've been spoiled by Powerbuilder, which has fantastic functionality for this out of the box.

是否有人认真编写自定义文档分页器对象来处理其 LOB 应用程序的报告需求?我希望能够免费"打印,而不必为了获取屏幕上的内容并将其扔在纸上而疯狂编码.

Does anyone seriously write custom documentpaginator objects to handle reporting needs for their LOB apps? I want to be able to print "for free" and not have to code like crazy just to take whats on the screen and throw it on paper.

人们是如何做到这一点的?有没有人推荐的 3rd 方允许打印较大的数据网格?

How are people doing this? Does anyone have a recommended 3rd party for allowing printing of largish datagrids?

谢谢

推荐答案

分页数据网格是一个巨大的痛苦.简单地在页面上绘制网格是行不通的,因为您必须处理诸如固定布局、水平和垂直扩展单元格以显示所有数据、自动换行、将列和行拆分为页边距、将溢出页面的单元格拆分为多个页.请记住,您无法在一张纸上滚动或调整控件的大小.即使你找到了一个可以做到这一切的魔法控件,一个在屏幕上看起来不错的带有边框、阴影和背景的网格在纸上看起来并不好看.

Paginating datagrids is a huge, huge pain. Simply drawing the grid on a page will not work as you have to handle things like fixed layout, expanding cells horizontally and vertically to show all data, word wrapping, splitting columns and rows into the page margin, splitting cells that overflow a page into multiple pages. Remember you can't scroll or resize a control on a piece of paper. Even if you find a magic control that can do all that, a grid with borders, shadows, and backgrounds that look good on a screen won't look good on paper.

对于打印数据网格的旧 WinForms 应用程序,我们为打印输出实现了一个完全独立的报告 API.我们使用免费的 ReportViewer<打印了底层 ADO.Net 数据源/a> 控制.教程位于 gotreportviewer.com.

For an old WinForms app that printed datagrids we implemented a completely separate report API for printouts. We printed the underlying ADO.Net dataSource using the free ReportViewer control. A tutorial is at gotreportviewer.com.

这篇关于WPF:打印分页数据网格的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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