Click or drag to resize
PageBreakCollectionT Class
Generic base class for page break collections.
Inheritance Hierarchy
SystemObject
  GemBox.SpreadsheetPageBreakCollection
    GemBox.SpreadsheetPageBreakCollectionT
      GemBox.SpreadsheetHorizontalPageBreakCollection
      GemBox.SpreadsheetVerticalPageBreakCollection

Namespace:  GemBox.Spreadsheet
Assembly:  GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1033
Syntax
public abstract class PageBreakCollection<T> : PageBreakCollection, 
	IEnumerable<T>, IEnumerable
where T : PageBreak

Type Parameters

T
Type of the items in the collection, either HorizontalPageBreak or VerticalPageBreak.

The PageBreakCollectionT type exposes the following members.

Properties
  NameDescription
Public propertyCount
Gets the number of page breaks contained in the collection.
(Inherited from PageBreakCollection.)
Top
Methods
  NameDescription
Public methodClear
Removes all page breaks.
(Inherited from PageBreakCollection.)
Public methodGetEnumerator
Returns an enumerator for the collection.
Public methodRemoveAt
Removes the page break at the specified index.
(Inherited from PageBreakCollection.)
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