# Re: 请问如何设计把 dbgrid的内容用列表机列印出来....

Posted by 老怪 on March 01, 1999 at 07:33:42:

In Reply to: 请问如何设计把 dbgrid的内容用列表机列印出来.... posted by 江正凯 on February 27, 1999 at 22:33:29:

: 在一个form上有dbgrid，dbgrid的datasource是来自一个data控制项
: 然后在form上有一个列印的command buttun
: 请问如何才能够把dbgrid的内容列印出来
: 不知 printer.print data.recordset可不可以??
: 很急！！烦请大家不吝告知，谢谢!!

Dim I As Long, J As Long
Dim PrintString As String
For I = 0 To DBGrid1.VisibleRows - 1
For J = 0 To DBGrid1.Columns.Count - 1
PrintString = PrintString & DBGrid1.Columns(J).CellText(DBGrid1.RowBookmark(I)) & "/"
Next
Printer.Print PrintString
PrintString = ""
Next

Printer.EndDoc

Follow Ups: