Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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);
Posted
Updated 28-Aug-17 21:44pm
Comments
FranzBe 28-Aug-17 11:33am    
I would suggest you have a look at rdlc reports and report viewer:

https://www.codeproject.com/Articles/25222/Microsoft-Reporting-without-SQL-Server-Reporting-S#

1 solution

Try the example from MSDN on PrintDocument. You use the pd_PrintPage parameter ev to ev.Graphics.DrawImage to draw onto the printer page.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900