Xceed Workbooks for .NET v2.0 Documentation
InsertPageBreaksAtCell Method
Example 


Xceed.Workbooks.NET Assembly > Xceed.Workbooks.NET Namespace > PageLayout Class : InsertPageBreaksAtCell Method
The Address of the Cell that is used as a reference point for the insertion; two page breaks will be added, one on top of the Cell & one at the left of it.
Inserts page breaks using a specific Cell as the target location for the insertion.
Syntax
'Declaration
 
Public Sub InsertPageBreaksAtCell( _
   ByVal cellAddress As String _
) 
'Usage
 
Dim instance As PageLayout
Dim cellAddress As String
 
instance.InsertPageBreaksAtCell(cellAddress)
public void InsertPageBreaksAtCell( 
   string cellAddress
)

Parameters

cellAddress
The Address of the Cell that is used as a reference point for the insertion; two page breaks will be added, one on top of the Cell & one at the left of it.
Example
public static void PageMarginsAndPageBreaks()
{
  using( var workbook = Workbook.Create( PageLayoutSample.PageLayoutSampleOutputDirectory + @"PageMarginsAndBreaks.xlsx" ))
    {
      // Gets the first worksheet; a workbook always contains at least 1 worksheet.
      var worksheet = workbook.Worksheets[0];
	  
      // Adds a title.
      worksheet.Cells["B1"].Value = "Page Margins and Breaks";
      worksheet.Cells["B1"].Style.Font = new Font() {Bold = true, Size = 15.5d};
	  
      // Inserts page breaks using specific cells as a target location for the insertion.
      worksheet.PageLayout.InsertPageBreaksAtCell("B2");
      worksheet.PageLayout.InsertPageBreaksAtCell("C3");
	  
      // Saves workbook to disk.
      workbook.Save();
      Console.WriteLine( "/tCreated:PageMarginsAndBreaks.xlsx/n" );
    }
}
Requirements

Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

PageLayout Class
PageLayout Members