问题
I'm working with Delphi 2009 and I really need to create a button that can print all my data in a DBGrid. I appreciate all the help I can get.
回答1:
Since it is a DB grid then you can create a report using any of the report components you have, or you can do without them by using the printers unit, by iterating over the data and print them using a printer.textout
回答2:
Get TxcellentFormPrinter control below and then you can print the Entire Grid.
http://www.code4sale.com/joehecht/
Hope this helps.
回答3:
You may use the TSMPrintData component from SMReport Autogenerated suite: http://www.scalabium.com/smr
回答4:
I don't know what you want but if you want to set your data into a TDbGrid then set your data into a dataset and link your dataset with the TDbGrid. But if you want to print your data from a DbGrid see Print a TDBGrid
来源:https://stackoverflow.com/questions/1221291/printing-a-tdbgrid