WPF:打印分页的datagrids的最佳方法 [英] WPF: Best method for printing paginated datagrids
问题描述
有没有人认真编写自定义的documentpaginator对象来处理他们的LOB的报表需求应用?我想要能够打印免费,而不必像疯狂的代码一样在屏幕上拍摄并将其扔在纸上。
人们如何做这个?有没有人有推荐的第三方允许打印大量的datagrids?
谢谢
分页数据表是一个巨大的巨大的痛苦。简单地在网页上绘制网格将不起作用,因为您必须处理固定布局,水平和垂直扩展单元格,以显示所有数据,换行,将列和行分割为页边距,将页面溢出的单元分割为多个页面。记住,您不能在一张纸上滚动或调整控件的大小。即使你发现一个可以做到这一切的魔术控制,一个屏幕上看起来很好的边框,阴影和背景的网格在纸上看起来不太好。
对于打印数据网格的旧WinForms应用程序,我们实现了一个完全独立的报告API打印输出。我们使用免费的 ReportViewer 控制。一个教程是 gotreportviewer.com 。
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.
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.
How are people doing this? Does anyone have a recommended 3rd party for allowing printing of largish datagrids?
Thanks
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.
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:打印分页的datagrids的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!