Skip to main content

IXlPageBreaks.Add(Int32) Method

Inserts a page break at the specified position.

Namespace: DevExpress.Export.Xl

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

NuGet Package: DevExpress.Printing.Core

Declaration

void Add(
    int position
)

Parameters

Name Type Description
position Int32

A positive integer that is the index of a row or column after which a page break should be inserted.

This value should start from 1 and cannot exceed 1,048,575 for rows or 16,383 for columns.

Remarks

To insert a horizontal page break after the specified row, call the Add method of IXlPageBreaks collection accessed from the IXlSheet.RowPageBreaks property.

To insert a vertical page break after the specified column, call the Add method of IXlPageBreaks collection accessed from the IXlSheet.ColumnPageBreaks property.

Important

The number of horizontal and vertical page breaks is limited and cannot exceed 1,026 per sheet.

For an example on how to add page breaks, refer to the How to: Insert Page Breaks in a Worksheet document.

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);
See Also