FarPoint Technologies
(800) 645-5913
fpsales@fpoint.com
|
|
You can simply print your spreadsheet or you can specify any of
the print options listed below.
You can set print page margins, set the
number to use to begin numbering the pages in the spreadsheet, select the page
orientation, and specify whether to print the spreadsheet border, column and
row headers, grid lines, colors, and shadow effect. You can specify the order
in which pages are printeddown then across, or across then down. You can
also specify header and footer text to appear on printed spreadsheet pages.
Preview Your
Spreadsheet | Calculate the Number of
Pages to Print | Print the Portion with
Data | Specify a Block of Cells as a
Print Range | Specify a Range of
Pages | Specify Print Page
Breaks | Add Header and Footer
Text | Print Multiple Items on the Same
Page Back to Top
You can preview the spreadsheet contents
before the data is sent to the printer. You can also set many options for the
preview control, including the number of pages to be displayed.
The
pages displayed in the fpSpreadPreview control reflect the print options you
set for the fpSpread control. These include the SmartPrint option, headers and
footers, and page break settings. |
 |
|
Back to Top
Based on the current print settings, you
can determine how many pages will print.
The following example uses the
PrintPageCount property to return the number of pages that will be
printed.
intPrint = fpSpread1.PrintPageCount |
 |
|
Back to Top
You can specify that only the spreadsheet
columns and rows that contain data are printed.
The following example
specifies to print only the rows and columns containing data
fpSpread1.PrintUseDataMax = True
fpSpread1.PrintSheet PrintFlagsNone |
|
|
Back to Top
You can specify any range of cells to
print.
The following example specifies a cell range B2 to D4 as the
print range.
fpSpread1.PrintUseDataMax = False
fpSpread1.Row = 2
fpSpread1.Col = 2
fpSpread1.Row2 = 4
fpSpread1.Col2 = 4
' Set the cell range to be printed
fpSpread1.PrintType = SS_PRINT_CELL_RANGE
fpSpread1.PrintSheet |
 |
|
Back to Top
You can specify any range of pages to
print.
The following example prints pages 2 through 4.
fpSpread1.PrintUseDataMax = False fpSpread1.PrintPageStart = 2
fpSpread1.PrintPageEnd = 4
fpSpread1.PrintType = PrintTypePageRange fpSpread1.PrintSheet |
|
|
Back to Top
You can set a print page break before a
specified column or row. You can also retrieve the number of the next column or
row in the spreadsheet where a page break occurs.
The following example
sets a print page break at row 10.
fpSpread1.Row = 10 fpSpread1.RowPageBreak = True
|
|
|
Back to Top
You can specify the text to appear as a
header or footer on the printed spreadsheet pages. You can also customize the
position and appearance of the header and footer text by using special control
characters included with Spread. These include
| New Line |
Font Name |
| Left align |
Font Size |
| Right align |
Font Bold |
| Center |
Font Italics |
| Insert Page Number |
Font Underline |
| Insert Page Count |
Font Strikethrough |
The following example provides header and
footer text for a spreadsheet. The header text is centered on the printed page.
The footer text has both left- and right-justified portions.
fpSpread1.PrintHeader = "/cFiscal Year 2001"
fpSpread1.PrintFooter = "DRAFT COPY/rDRAFT COPY" |
|
|
Back to Top
If you use the fpSpread ActiveX control,
you can use the Owner Print feature to print individual spreadsheet pages to a
specific area that you define on a printed page. This allows you to combine
multiple spreadsheets or other items on a single print out.
The
following example will print two spreadsheets. The first spreadsheet in the
upper half of the page and the second in the lower half of the page. There will
be a 1 inch margin around each of the spreadsheets. This example assumes the
printing will be done on a sheet of 8.5" X 11" paper.
Const PaperWidth = 12240
Const PaperHeight = 15840
Printer.Print
Call fpSpread1.OwnerPrintDraw(Printer.hDC, 1440, 1440, PaperWidth - 1440, PaperHeight / 2 - 1440, 1)
Call fpSpread2.OwnerPrintDraw(Printer.hDC, 1440, PaperHeight / 2 + 1440, PaperWidth - 1440, PaperHeight - 1440, 1)
Printer.EndDoc |
|
|
|
|
| Have a question? |
|
 |
|