Spread Windows Forms 10.0 Product Documentation
PrintType Property
Example 


Gets or sets what is to be printed.
Syntax
'Declaration
 
Public Property PrintType As PrintType
'Usage
 
Dim instance As PrintInfo
Dim value As PrintType
 
instance.PrintType = value
 
value = instance.PrintType
public PrintType PrintType {get; set;}

Property Value

PrintType setting that determines the type of print range
Remarks

If you set the value to PrintType.CellRange, specify the cell range by setting these PrintInfo properties:

If you set the value to PrintType.PageRange, specify the page range by setting these PrintInfo properties:

The setting of this property and the other print range properties might be overridden if the UseMax property is set to true. When the UseMax property is set to true, empty cells beyond the columns and rows containing data are not printed. You can return the number of the last column and row containing data using the SheetView NonEmptyColumnCount and NonEmptyRowCount properties.

Note: If you have set the SheetView FrozenColumnCount or FrozenRowCount property to freeze columns or rows, the frozen columns or rows also print with your range, even if they are not included in the range you specify.
Example
This example shows how to specify that only part of the sheet prints.
// Typically, not all of these settings are used together but are included here for illustration purposes

// Create the printer settings object
FarPoint.Win.Spread.PrintInfo printset = new FarPoint.Win.Spread.PrintInfo(); 

// Allow printing of only 20 columns and 20 rows of cells
printset.ColStart = 1;
printset.ColEnd = 20;
printset.RowStart = 1;
printset.RowEnd = 20;
printset.PrintType = FarPoint.Win.Spread.PrintType.CellRange;

// Allow printing of only five pages
printset.PageStart = 1;
printset.PageEnd = 5;

// Allow printing of the cell notes together at the end
printset.PrintNotes = FarPoint.Win.Spread.PrintNotes.AtEnd;

// Allow printing of the shapes
printset.PrintShapes = true;

// Allow printing of only rows and columns up to the last ones with data 
printset.UseMax = True;

// Assign the printer settings to the sheet and print it
fpSpread1.Sheets[0].PrintInfo = printset; 
fpSpread1.PrintSheet(0);
' Typically, not all of these settings are used together but are included here for illustration purposes

' Create the printer settings object
Dim printset As New FarPoint.Win.Spread.PrintInfo

' Allow printing of only 20 columns and 20 rows of cells
printset.ColEnd = 20
printset.ColStart = 1
printset.RowStart = 1
printset.RowEnd = 20
printset.PrintType = FarPoint.Win.Spread.PrintType.CellRange

' Allow printing of only five pages
printset.PageStart = 1
printset.PageEnd = 5

' Allow printing of the cell notes together at the end
printset.PrintNotes = FarPoint.Win.Spread.PrintNotes.AtEnd

' Allow printing of the shapes
printset.PrintShapes = True

' Allow printing of only rows and columns up to the last ones with data 
printset.UseMax = true

' Assign the printer settings to the sheet and print it
FpSpread1.Sheets(0).PrintInfo = printset
FpSpread1.PrintSheet(0)
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

PrintInfo Class
PrintInfo Members
PrintType Enum
UseMax Property
FrozenColumnCount Property (SheetView Class)
FrozenRowCount Property (SheetView Class)
NonEmptyColumnCount Property (SheetView Class)
NonEmptyRowCount Property (SheetView Class)
ColEnd Property
ColStart Property
PageEnd Property
PageStart Property
RowEnd Property
RowStart Property

User-Task Documentation

Printing Particular Pages

 

 


Copyright © GrapeCity, inc. All rights reserved.