Click or drag to resize
VerticalPageBreak Class
Specifies a vertical position where the new page begins when the worksheet is printed.
Inheritance Hierarchy

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1033
Syntax
public sealed class VerticalPageBreak : PageBreak

The VerticalPageBreak type exposes the following members.

Properties
  NameDescription
Public propertyColumn
Index of the first column of the new page.
Public propertyFirstRow
Index of the first row of the new page.
Public propertyLastRow
Index of the last row of the new page.
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