Back to Devexpress

How to: Print Titles on a Worksheet

officefileapi-119926-spreadsheet-document-api-examples-printing-how-to-print-titles-on-a-worksheet.md

latest2.1 KB
Original Source

How to: Print Titles on a Worksheet

  • Sep 19, 2023

This example demonstrates how to print titles (row and column headings) on every page. To do this, use the following members of the WorksheetPrintTitleOptions object, which can be accessed using the WorksheetPrintOptions.PrintTitles property.

|

Members

|

Description

| | --- | --- | |

WorksheetPrintTitleOptions.Rows

WorksheetPrintTitleOptions.SetRows

|

Repeat specific rows at the top of every printed page.

| |

WorksheetPrintTitleOptions.Columns

WorksheetPrintTitleOptions.SetColumns

|

Repeat specific columns on the left side of every printed page.

|

csharp
// Access an object that contains print options.
WorksheetPrintOptions printOptions = worksheet.PrintOptions;
// Print the first column and the first row on every page.
printOptions.PrintTitles.SetColumns(0, 0);
printOptions.PrintTitles.SetRows(0, 0);
vb
' Access an object that contains print options.
Dim printOptions As WorksheetPrintOptions = worksheet.PrintOptions
' Print the first column and the first row on every page.
printOptions.PrintTitles.SetColumns(0, 0)
printOptions.PrintTitles.SetRows(0, 0)

To remove print titles from a specific worksheet, use the WorksheetPrintTitleOptions.Clear method.

See Also

How to: Print a Workbook

How to: Specify Print Settings