如何使用C#中的datagridview内容打印帐单? [英] How to print a bill with datagridview contents in C#?
本文介绍了如何使用C#中的datagridview内容打印帐单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要知道我们如何在datagridview中制作帐单然后如何进行打印?
我尝试了什么:
位图bm =新位图(this.dataGridView1.Width,this.dataGridView1.Height);
dataGridView1.DrawToBitmap(bm,new Rectangle(0,0,this.dataGridView1.Width,this.dataGridView1.Height));
e.Graphics。 DrawImage(bm,0,0);
I need to know that how we can make a bill in datagridview and then how to proceeds to print?
What I have tried:
Bitmap bm = new Bitmap(this.dataGridView1.Width, this.dataGridView1.Height);
dataGridView1.DrawToBitmap(bm, new Rectangle(0, 0, this.dataGridView1.Width, this.dataGridView1.Height));
e.Graphics.DrawImage(bm, 0, 0);
推荐答案
尝试 PrintDocument上的MSDN 。您使用pd_PrintPage参数ev到ev.Graphics.DrawImage来绘制到打印机页面。
Try the example from MSDN on PrintDocument. You use the pd_PrintPage parameter ev to ev.Graphics.DrawImage to draw onto the printer page.
这篇关于如何使用C#中的datagridview内容打印帐单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文