# Print Options

Describes the various print options available in Spread WPF.

## Content

This topic explains various printing options available in Spread for WPF. You can print a worksheet, the complete workbook, or a specified range of worksheets based on your requirements.
To perform all these printing operations, use the [Print](/spreadnet/api/latest/online-wpf/GrapeCity.Wpf.SpreadSheet/GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.Print.html) and [PrintToDocument](/spreadnet/api/latest/online-wpf/GrapeCity.Wpf.SpreadSheet/GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.PrintToDocument.html) methods of the **GcSpreadSheet** class. Using the PrintToDocument method, you can view the printed pages in the DocumentViewer. However, if you want to print without customizing any print settings, simply pass NULL to these print methods.
Note that the following are not supported during the printing process.

* Active cell appearance
* Selection appearance
* Filter button
* Sort indicator

## Print Workbook

To print an entire workbook, use the [Print](/spreadnet/api/latest/online-wpf/GrapeCity.Wpf.SpreadSheet/GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.Print.html) method of **GcSpreadSheet** class. You need to set the parameter of this method to -1 to include all the worksheets of the workbook for printing.
The following example code prints the complete workbook.
**C#**

```csharp
// Print all worksheets (the entire workbook).
GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings printSetting = new GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings();
spreadSheet1.Print(-1, printSetting, true);
```

**VB**

```auto
' Print all worksheets (the entire workbook).
Dim printSetting As GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings = New GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings()
spreadSheet1.Print(-1, printSetting, True)
```

## Print Worksheet

To print a worksheet, use the [Print](/spreadnet/api/latest/online-wpf/GrapeCity.Wpf.SpreadSheet/GrapeCity.Wpf.SpreadSheet.GcSpreadSheet.Print.html) method of the **GcSpreadSheet** class. To print individual worksheets in a workbook, you need to specify a worksheet by its index. The default value of this method is -1, which prints the entire workbook.
The following example code shows how to print a worksheet with index 1.
**C#**

```csharp
// "1" is the index of the worksheet to print.
GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings printSetting = new GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings();
spreadSheet1.Print(1, printSetting, true);
```

**VB**

```auto
' "1" is the index of the worksheet to print.
Dim printSetting As GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings = New GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings()
spreadSheet1.Print(1, printSetting, True)
```

## Print Range of Worksheets

To print a range of worksheets in a workbook, define the range to print by specifying the first and last worksheets in the [FromPage](/spreadnet/api/latest/online-wpf/GrapeCity.Wpf.SpreadSheet/GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings.FromPage.html) and [ToPage](/spreadnet/api/latest/online-wpf/GrapeCity.Wpf.SpreadSheet/GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings.ToPage.html) properties of the **PrintSettings** class.
The following example code shows how to print a specific range of worksheets within a workbook.
**C#**

```csharp
// Print from page 1 to page 3.
GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings printSetting = new GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings();
printSetting.FromPage = 1;
printSetting.ToPage = 3;
spreadSheet1.Print(-1, printSetting, true);
```

**VB**

```auto
' Print from page 1 to page 3.
Dim printSetting As GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings = New GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings()
printSetting.FromPage = 1
printSetting.ToPage = 3
spreadSheet1.Print(-1, printSetting, True)
```

## Print Cell Range

To print a specific area of a worksheet, you can specify the print region rather than printing the entire workbook. Set the [PrintArea](/spreadnet/api/latest/online-wpf/GrapeCity.Wpf.SpreadSheet/GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings.PrintArea.html) property in the **PrintSettings** class to specify the cell range that you want to define as the print area. You can set the range to be printed as a **Reference** with row/column indexes or as A1 references. However, if you set the PrintArea to **Reference.Empty**, it prints the complete worksheet. Note that this property applies only to the worksheets.
The following example code shows how to set the print area in the worksheet.
**C#**

```csharp
GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings printSetting = new GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings();
// Set print area.
printSetting.PrintArea = new Reference("A1:E5");
spreadSheet1.Print(1, printSetting, true); // Specify -1 to print all sheets.
```

**VB**

```auto
Dim printSetting As GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings = New GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings()
' Set print area.
printSetting.PrintArea = New Reference( "A1:E5" )
spreadSheet1.Print(1, printSetting, True) ' Specify -1 to print all sheets.
```

## Print Titles

Print titles allow you to choose which rows and columns should appear repeatedly on each printed page. The rows' title indicates the rows that contain the cells to be repeated at the top of each page, while the columns' title specifies the columns that contain the cells to be repeated on the left side of each page.
Use [PrintTitleRows](/spreadnet/api/latest/online-wpf/GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.Printing.IPageSetup.PrintTitleRows.html) and [PrintTitleColumns](/spreadnet/api/latest/online-wpf/GrapeCity.Spreadsheet/GrapeCity.Spreadsheet.Printing.IPageSetup.PrintTitleColumns.html) properties of the **IPageSetUp** interface to select which rows and columns will appear on each printed page.
The following example code sets the rows and columns that will be printed as titles on each page.
**C#**

```csharp
// Set print titles for rows and columns.
GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings printSetting = new GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings();
spreadSheet1.Workbook.ActiveSheet.PageSetup.PrintTitleRows = new Reference("3:3");
spreadSheet1.Workbook.ActiveSheet.PageSetup.PrintTitleColumns = new Reference("A:C");
spreadSheet1.Print(-1, printSetting, true);
```

**VB**

```auto
' Set print titles for rows and columns.
Dim printSetting As GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings = New GrapeCity.Wpf.SpreadSheet.Printing.PrintSettings()
spreadSheet1.Workbook.ActiveSheet.PageSetup.PrintTitleRows = New Reference("3:3")
spreadSheet1.Workbook.ActiveSheet.PageSetup.PrintTitleColumns = New Reference("A:C")
spreadSheet1.Print(-1, printSetting, True)
```