Mega Code Archive

 
Categories / Delphi / Printing
 

Printing a tstringgrid or a tdbgrid

Question: How do I Print a TStingGrid / TDBGrid? Answer: You will need to create two loops, one to print each row, and one to print each column using TPrinter's TextOut method. You should determine the widest line of text in the grid you will need to accommodate and adjust your font size as necessary, or decide if you need to print some of the columns on a separate page.