TPrintOptions Enumeration
How the sheet should be printed. You can mix value together by and'ing and or'ing the flags. See the example to see how to set or clear one specific value of the enumeration.
Syntax
Unit: FlexCel.Core
Members
Name | Value | Description |
---|---|---|
LeftToRight | 0 | Print over, then down. You can change this by using xls.PrintOverThenDown. |
Orientation | 1 | 0= landscape, 1=portrait. You can change this by using xls.PrintLandscape. |
NoPls | 2 | if 1, then PaperSize, Scale, Res, VRes, Copies, and Landscape data have not been obtained from the printer, so they are not valid. MAKE SURE YOU MAKE THIS BIT = 0 *BEFORE* CHANGING ANY OTHER OPTION. THEY WILL NOT CHANGE IF THIS IS NOT SET. |
NoColor | 3 | 1= Black and white. You can change this by using xls.PrintBlackAndWhite. |
Draft | 4 | 1= Draft quality. You can change this by using xls.PrintDraftQuality. |
Notes | 5 | 1= Print Notes. Use xls.PrintComments instead. |
NoOrient | 6 | 1=orientation not set |
UsePage | 7 | 1=use custom starting page number. Use xls.PrintFirstPageNumber to set this instead. |
Examples
Here we will show how to set the page orientation to landscape or portrait. You can do this simply by using
xls.PrintLandscape := true;
but if you wanted to do it with PrintOptions, you would do the following:
// Remember that you can always do xls.PrintLandscape = true instead of this code.
if Landscape then
begin
xls.PrintOptions:= xls.PrintOptions - [TPrintOptions.Orientation, TPrintOptions.NoPls]
end else
begin
//ALWAYS REMOVE NOPLS BEFORE CHANGING THE OTHER OPTIONS.
xls.PrintOptions:= xls.PrintOptions - [TPrintOptions.NoPls];
xls.PrintOptions:= xls.PrintOptions + [TPrintOptions.Orientation];
end;