Click or drag to resize
HorizontalPageBreak Class
Specifies a horizontal 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 HorizontalPageBreak : PageBreak

The HorizontalPageBreak type exposes the following members.

Properties
  NameDescription
Public propertyFirstColumn
Index of the first column of the new page.
Public propertyLastColumn
Index of the last column of the new page.
Public propertyRow
Index of the first 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