Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to print a datagridview with all rows and all columns? [duplicate]

Tags:

c#

.net-3.5

I need to add some functionality to be able to print whatever is displayed in datagridview. I tried to use bitmap class but it does not seem to be printing all the rows and columns. It looks like a screenshot and missing some columns and rows. Anybody knows any better way to handle this? Thanks so much.

like image 969
Jyina Avatar asked Mar 22 '11 21:03

Jyina


2 Answers

There are some examples/utilities on CodeProject:

  • http://www.codeproject.com/KB/printing/PrintingOfDataGridView.aspx

  • http://www.codeproject.com/KB/printing/GridPrintPreviewSolution.aspx
    http://www.codeproject.com/KB/printing/GridPrintPreviewSolution2.aspx

  • http://www.codeproject.com/KB/printing/DGVPrinter.aspx

like image 128
digEmAll Avatar answered Nov 11 '22 14:11

digEmAll


Check this link :

How To Print a Data Grid in C# and .NET

And Have you tried creating local report (rdlc and using Reportviewer)?

This will also help you to create custom reports..

Regards

like image 38
Crimsonland Avatar answered Nov 11 '22 15:11

Crimsonland