|
|
Printing
| Methods: |
PrintSetup, PrintPreview, Print |
Properties: |
HeaderRows, FooterRows |
Customizing the footer and header
Specify one row for the header and one row for the footer:
' First row of the grid will be printed on each page
grid.HeaderRows = 1
' Last row of the grid will be printed on each page
grid.FooterRows = 1
' Insert a page counter into the header
grid.MergeCells "A", 0, 0, 0, 1, 0
grid.Cell("A",0).Value = "Page:"
grid.MergeCells "C", 0, 0, 0, 1, 0
grid.Cell("C",0).Value = "%pagenum%"
|
|
Print setup
To open the Print Setup dialog use the PrintSetup method:
Print preview
To show the Print Preview window call the PrintPreview method:
' Add some data for printing
grid.Cell("A",1).Value = "a"
grid.PrintPreview "Example Document"
|
|
Printing the document
Now print the document:
| grid.Print "Example Document"
|
|
|