PrintInfo Reference > PrintInfo Methods > PrintData Method (PrintInfo) |
The PrintData method prints the specified rows in the associated grid using the currently selected printer.
PrintInfo.PrintData [selector]
Arguments
selector is an optional RowSelectorConstants value that specifies the rows to be printed.
Return Value
None
Generally, the selected printer is the system default printer, although you can use the PageSetup method to enable end users to select a different printer prior to calling the PrintData method.
The selector argument determines the rows to be printed. It can be one of the following constant values:
0 - dbgAllRows |
All available rows are printed. If the selector argument is omitted, this value is assumed. |
1 - dbgSelectedRows |
Only selected rows are printed. The grid's SelBookmarks collection contains a bookmark for each selected row. |
2 - dbgCurrentRow |
Only the current row is printed. The grid's Bookmark property returns the bookmark of the current row. |
The printed output preserves as much of the associated grid's original formatting as possible, including colors, fonts, alignment, and relative column widths. If present, the grid caption, split captions, column headers, and column footers are displayed on the first page. You can force these elements to be repeated on each physical page by setting the RepeatGridHeader, RepeatSplitHeaders, RepeatColumnHeaders, and RepeatColumnFooters properties to True.
Note
Use the PrintPreview method to enable end users to view and scale the output before optionally printing it.