Table of Contents

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

Namespace: FlexCel.Core

Members

Name Value Description
None 0 All options cleared.
LeftToRight 1 Print over, then down. You can change this by using xls.PrintOverThenDown.
Orientation 2 0= landscape, 1=portrait. You can change this by using xls.PrintLandscape.
NoPls 4 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 8 1= Black and white. You can change this by using xls.PrintBlackAndWhite.
Draft 16 1= Draft quality. You can change this by using xls.PrintDraftQuality.
Notes 32 1= Print Notes. Use xls.PrintComments instead.
NoOrient 64 1=orientation not set
UsePage 128 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)
        xls.PrintOptions &= ~(TPrintOptions.Orientation | TPrintOptions.NoPls);
    else
    {
        //ALWAYS SET NOPLS TO 0 BEFORE CHANGING THE OTHER OPTIONS.
        xls.PrintOptions &= ~TPrintOptions.NoPls;
        xls.PrintOptions |= TPrintOptions.Orientation;
    }