使用Datagrid View进行表格打印,涉及页眉和页脚 [英] Form Printing with Datagrid View involving header and footer

查看:84
本文介绍了使用Datagrid View进行表格打印,涉及页眉和页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表单布局.我想以与显示的格式相同的格式打印它...只有按钮不应该出现,其余所有东西都应该放在那儿,并且它应该看起来像是账单打印.
表单中有一个datagrid,中间也应该有一个datagrid.如果数据网格视图的行数超过8,则应自动获取第二页并以相同的布局继续打印.

hi i HAVE a form layout. i want to print it in same format as it is displayed... only the buttons should not come and rest everything should be there and it should look like a bill print.
the form has a datagrid in between which should also come. if data grid view has more than 8 rows then it should automatically take a second page and continue with same layout and print it.

推荐答案

如果将被打印,那么按原样打印表格是不可取的.相反,最好使用这些Code Project文章中给出的printing
通过选择列和行进行DataGridView打印 [ ^ ]
在DotNet Framework上打印DataGridView [ http://www.completit.com/Portfolio/DGVE/Overview.aspx [ ^ ]
它具有免费版本,具有将数据打印和导出为不同格式的功能

但是,如果要打印Form 以检查布局等,那么我认为该程序
http://cropper.codeplex.com/ [ ^ ]
可以很好地捕获窗口,然后打印捕获的图像.
If the contents of the DataGridView are to be printed, then it is not preferable to print the form as it is. Instead it is better to use printing as given in these Code Project articles
DataGridView Printing by Selecting Columns and Rows[^]
Printing a DataGridView on DotNet Framework[^]
and this Control,
http://www.completit.com/Portfolio/DGVE/Overview.aspx[^]
which has a free version, has the features to print and export the data to different formats

However, if the Form is to be printed for checking the layout etc. then I think this program
http://cropper.codeplex.com/[^]
is good to capture the window and then to print the image captured.


使用可视基本电源包
打印表单
如果在Visual Basic Power Packs下使用VS Professional,则可以在工具箱中使用它.
http://msdn.microsoft.com/zh-CN/library/system. drawing.printing.printdocument(v = vs.71).aspx [ PrintDocument类
Use visual basic power packs
Print Form
It is avilable in toolbox if you are using VS Professional under visual basic power packs.
http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument(v=vs.71).aspx[^]
PrintDocument Class


这篇关于使用Datagrid View进行表格打印,涉及页眉和页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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