Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / PageLayout Class
Members Example


In This Topic
    PageLayout Class
    In This Topic
    Defines the options related to the Worksheet's page & printing layouts. 
    Syntax
    'Declaration
     
    
    Public Class PageLayout 
       Inherits WorksheetElement
    'Usage
     
    
    Dim instance As PageLayout
    public class PageLayout : WorksheetElement 
    Example
    public static void PageOrientationAndSetup()
    {
      using( var workbook = Workbook.Create(PageLayoutSample.PageLayoutSampleOutputDirectory + @"PageSetup.xlsx"))
        {
          //Gets the first worksheet; a workbook contains at least 1 worksheet.
          var worksheet = workbook.Worksheets[0];
    	  
          // Adds a title.
          worksheet.Cells["B1"].Value = "Page Setup";
          worksheet.Cells["B1"].Style.Font = new Font() {Bold = true, Size = 15.5d};
    	  
          // Sets the Landscape orientation.
          worksheet.PageLayout.Orientation = OrientationType.Landscape;
    	  
          // Adjusts the paper size.
          worksheet.PageLayout.PageSize = PaperSizeType.Executive;
    	  
          // Adjusts the scale, which is a percentage.
          worksheet.PageLayout.Scale = 120;
    
          // Sets various printing options.
          worksheet.PageLayout.BlackAndWhite = true;
          worksheet.PageLayout.DraftQuality = true;
          worksheet.PageLayout.GridLines = true;
          worksheet.PageLayout.Headings = true;
          worksheet.PageLayout.HorizontalCentered = true;
          worksheet.PageLayout.VerticalCentered = true;
    
          // Saves the workbook to disk.
          workbook.Save();
          Console.WriteLine( "/tCreated: PageSetup.xlsx/n" );
        }
    }
    Inheritance Hierarchy

    System.Object
       Xceed.Workbooks.NET.WorkbookElement
          Xceed.Workbooks.NET.WorksheetElement
             Xceed.Workbooks.NET.PageLayout

    Public Constructors
     NameDescription
    Public Constructor  
    Top
    Public Properties
     NameDescription
    Public PropertyGets or sets if the Worksheet(s) will be printed in black & white or not.  
    Public PropertyGets a list of indexes that correspond to all of the column breaks in the Worksheet.  
    Public PropertyGets or sets whether the Worksheet(s) will be printed in draft quality or not.  
    Public PropertyGets or sets how the content's height will be scaled when the Worksheet is printed.  
    Public PropertyGets or sets how the content's width will be scaled when the Worksheet is printed.  
    Public PropertyGets or sets if gridlines should be printed or not.  
    Public PropertyGets or sets whether headings will be printed or not.  
    Public PropertyGets or sets if the content will be centered horizontally when the Worksheet(s) is printed.  
    Public PropertyGets the Worksheet's Margins.  
    Public PropertyGets or sets the page's orientation.  
    Public PropertyGets or sets the page's size.  
    Public PropertyGets a list of indexes that correspond to all of the row breaks in the Worksheet.  
    Public PropertyGets or sets the percentage by which the Worksheet's content will be scaled before it is printed.  
    Public PropertyGets or sets if the content will be centered vertically when the Worksheet(s) is printed.  
    Top
    Public Methods
     NameDescription
    Public MethodOverloaded.   
    Public Method  
    Public MethodInserts a page break at the left of a specific Column.   
    Public MethodInserts a page break on top of a specific Row.   
    Public MethodInserts page breaks in the Worksheet, using a Row & a Column to determine where those page breaks will be inserted.  
    Public MethodInserts page breaks in the Worksheet, using the location of a specific Cell to determine where those page breaks will be inserted.    
    Public MethodRemoves the page break at the left of a specific Column.   
    Public MethodRemoves the page break that is located on top of a specific Row.  
    Public MethodRemoves page breaks from the Worksheet, using a Row & a Column to determine which page breaks will be removed.  
    Public MethodRemoves page breaks from the Worksheet, using the location of a specific Cell to determine which page breaks will be removed.  
    Public MethodResets all page breaks to their default state.   
    Top
    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