Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

Use the Excel Export API to Print Titles on a Worksheet

The example below demonstrates how to print specific rows and columns on every page. To do this, use methods of the XlPrintTitles object accessible from the IXlSheet.PrintTitles property.

  • To repeat specific rows at the top of the printed page, use the XlPrintTitles.SetRows method and pass the zero-based indexes of the first row and the last row to be printed.
  • To repeat specific columns on the left side of the printed page, use the XlPrintTitles.SetColumns method and pass the zero-based indexes of the first column and the last column to be printed.

View Example

// Print the first column and the first row on every page.
sheet.PrintTitles.SetColumns(0, 0);
sheet.PrintTitles.SetRows(0, 0);