ComponentOne Excel for .NET
C1.Excel Assembly / C1.Excel Namespace / XLRow Class / PageBreak Property
Example

In This Topic
    PageBreak Property (XLRow)
    In This Topic
    Gets or sets whether there will be a forced page break after this row.
    Syntax
    'Declaration
     
    Public Property PageBreak As System.Boolean
    public System.bool PageBreak {get; set;}
    Example
    The code below inserts forced page breaks at every 10th row on a sheet, and clears the breaks at all other rows.
    C1.C1Excel.XLSheet sheet = c1XLBook1.Sheets[0];
    for (int r = 0; r < sheet.Rows.Count; r++)
    {
        sheet.Rows[r].PageBreak = (r > 0 && r % 10 == 0);
    }
    See Also