IXlPageBreaks Interface
A collection of page breaks in a worksheet.
Namespace: DevExpress.Export.Xl
Assembly: DevExpress.Printing.v24.2.Core.dll
Declaration
Related API Members
The following members return IXlPageBreaks objects:
Remarks
Page breaks in the worksheet are contained in two IXlPageBreaks collections and can be accessed using the IXlSheet.RowPageBreaks and IXlSheet.ColumnPageBreaks properties.
To insert a page break after the specified row or column, use the IXlPageBreaks.Add method. To remove the required page break from the collection, use the IXlPageBreaks.Remove or IXlPageBreaks.RemoveAt method. To clear all column or row page breaks at once, use the IXlPageBreaks.Clear method. For an example on how to add page breaks to manually split a worksheet into pages, refer to the How to: Insert Page Breaks in a Worksheet topic.
The image below shows the horizontal (row) page break inserted after the tenth row and the vertical (column) page break inserted after column "B" (the workbook is opened in Microsoft® Excel®).
Example
Note
A complete sample project is available at https://github.com/DevExpress-Examples/excel-export-api-examples
// Insert a page break after the column "B".
sheet.ColumnPageBreaks.Add(2);
// Insert a page break after the tenth row.
sheet.RowPageBreaks.Add(10);