'Declaration
Public Class PageLayout Inherits WorksheetElement
'Usage
Dim instance As PageLayout
public class PageLayout : WorksheetElement
'Declaration
Public Class PageLayout Inherits WorksheetElement
'Usage
Dim instance As PageLayout
public class PageLayout : WorksheetElement
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" ); } }
System.Object
Xceed.Workbooks.NET.WorkbookElement
Xceed.Workbooks.NET.WorksheetElement
Xceed.Workbooks.NET.PageLayout
Name | Description | |
---|---|---|
![]() | PageLayout Constructor |
Name | Description | |
---|---|---|
![]() | BlackAndWhite | Gets or sets if the Worksheet(s) will be printed in black & white or not. |
![]() | ColumnBreaks | Gets a list of indexes that correspond to all of the column breaks in the Worksheet. |
![]() | DraftQuality | Gets or sets whether the Worksheet(s) will be printed in draft quality or not. |
![]() | FitToPageHeight | Gets or sets how the content's height will be scaled when the Worksheet is printed. |
![]() | FitToPageWidth | Gets or sets how the content's width will be scaled when the Worksheet is printed. |
![]() | GridLines | Gets or sets if gridlines should be printed or not. |
![]() | Headings | Gets or sets whether headings will be printed or not. |
![]() | HorizontalCentered | Gets or sets if the content will be centered horizontally when the Worksheet(s) is printed. |
![]() | Margins | Gets the Worksheet's Margins. |
![]() | Orientation | Gets or sets the page's orientation. |
![]() | PaperSize | Gets or sets the page's size. |
![]() | RowBreaks | Gets a list of indexes that correspond to all of the row breaks in the Worksheet. |
![]() | Scale | Gets or sets the percentage by which the Worksheet's content will be scaled before it is printed. |
![]() | VerticalCentered | Gets or sets if the content will be centered vertically when the Worksheet(s) is printed. |
Name | Description | |
---|---|---|
![]() | Equals | Overloaded. |
![]() | GetHashCode | |
![]() | InsertPageBreakColumn | Inserts a page break at the left of a specific Column. |
![]() | InsertPageBreakRow | Inserts a page break on top of a specific Row. |
![]() | InsertPageBreaks | Inserts page breaks in the Worksheet, using a Row & a Column to determine where those page breaks will be inserted. |
![]() | InsertPageBreaksAtCell | Inserts page breaks in the Worksheet, using the location of a specific Cell to determine where those page breaks will be inserted. |
![]() | RemovePageBreakColumn | Removes the page break at the left of a specific Column. |
![]() | RemovePageBreakRow | Removes the page break that is located on top of a specific Row. |
![]() | RemovePageBreaks | Removes page breaks from the Worksheet, using a Row & a Column to determine which page breaks will be removed. |
![]() | RemovePageBreaksAtCell | Removes page breaks from the Worksheet, using the location of a specific Cell to determine which page breaks will be removed. |
![]() | ResetAllPageBreaks | Resets all page breaks to their default state. |
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