Skip to main content
A newer version of this page is available. .

IXlPageBreaks Interface

A collection of page breaks in a worksheet.

Namespace: DevExpress.Export.Xl

Assembly: DevExpress.Printing.v20.2.Core.dll

NuGet Packages: DevExpress.Printing.Core, DevExpress.WindowsDesktop.Printing.Core

Declaration

public interface IXlPageBreaks :
    IEnumerable<int>,
    IEnumerable,
    ICollection

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®).

XlExport_Printing_PageBreaks

Example

// Insert a page break after the column "B".
sheet.ColumnPageBreaks.Add(2);
// Insert a page break after the tenth row.
sheet.RowPageBreaks.Add(10);
See Also