Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to print a data grid containing 24 columns within proper tabular format.
looking for favorable reply soon .Thank You.
Posted

See this Google Search Link
Here[^]

Thanks
--RA
 
Share this answer
 
use this code on button click
C#
PrintDialog myPrintDialog = new PrintDialog();
            System.Drawing.Bitmap memoryImage = new System.Drawing.Bitmap(dataGridView1.Width, dataGridView1.Height);
            dataGridView1.DrawToBitmap(memoryImage, dataGridView1.ClientRectangle);
            if (myPrintDialog.ShowDialog() == DialogResult.OK)
            {
                System.Drawing.Printing.PrinterSettings values;
                values = myPrintDialog.PrinterSettings;
                myPrintDialog.Document = printDocument1;
                printDocument1.PrintController = new StandardPrintController();
                printDocument1.Print();
            }
            printDocument1.Dispose();
 
Share this answer
 
Comments
shilpa sonawane 30-Jan-12 5:27am    
I want to print 24 columns ...Its not fitting within that page.

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