Click or drag to resize
PageBreakCollection Class
Base class for page break collections.
Inheritance Hierarchy

Namespace: GemBox.Spreadsheet
Assembly: GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1000
Syntax
public abstract class PageBreakCollection : IEnumerable

The PageBreakCollection type exposes the following members.

Methods
  NameDescription
Public methodClear
Removes all page breaks.
Public methodGetEnumerator
Returns an enumerator for the collection.
Public methodRemoveAt
Removes the page break at the specified index.
Top
Properties
  NameDescription
Public propertyCount
Gets the number of page breaks contained in the collection.
Top
Examples

Following code demonstrates how to add PageBreaks to ExcelWorksheet.

int columnsPerPage = 6, rowsPerPage = 30;

int usedColumnsCount = ws.CalculateMaxUsedColumns();
for (int i = columnsPerPage; i < usedColumnsCount; i += columnsPerPage)
    ws.VerticalPageBreaks.Add(i);

for (int i = rowsPerPage; i < ws.Rows.Count; i += rowsPerPage)
    ws.HorizontalPageBreaks.Add(i);
See Also