Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing from a Datagridview

Status
Not open for further replies.

Denster

Programmer
Apr 9, 2001
198
GB
I am trying to print from a datagrid view that is formatted with color coded columns. At the moment I am using the .drawtobitmap function and using the printdocument control to print. This all works but the quality of the text in the grid is poor. Is there any way I can improve the quality other than automate excel!. I am also printing some text from the labels using the .DrawString function of the label and the text from this is quite acceptable.
 
I would look into using a ReportViewer Control for printing.
 
I'v never used a reportViewer but surely I'm going to run into the same problems when I come to print. The printing aspect needs to be done programaticaly.
 
You can use the PrintDocument class. It's fairly involved and advanced though.
 
Like I said in my original post I am using the printdocument control to print the image produced from the datagrid. The problem is the quality is rubish. Are there any properties in the control that I'm missing perhaps.
 
I was referring to drawing your own strings and borders -- not rendering a bitmap of your grid.

I'm not sure if you can change the quality of the rendered bitmap. You can change the quality of a graphics object itself....but you're kind of bypassing that going directly to the bitmap.
 
You might want to look at a free add-in called DatagridViewExtension. The version I am using is 1.1 with VS 2005 and VS 2008.

It should provide the needed functionality and is decent enough for a free tool.


=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top