- Notifications
You must be signed in to change notification settings - Fork906
Pages Tab
Francois Botha edited this pageFeb 26, 2018 ·2 revisions

varworkbook=newXLWorkbook();varws1=workbook.Worksheets.Add("Page Setup - Page1");ws1.PageSetup.PageOrientation=XLPageOrientation.Landscape;ws1.PageSetup.AdjustTo(80);ws1.PageSetup.PaperSize=XLPaperSize.LegalPaper;ws1.PageSetup.VerticalDpi=600;ws1.PageSetup.HorizontalDpi=600;
For more information on the paper size enumeration please see thePaper Size Lookup Table

varws2=workbook.Worksheets.Add("Page Setup - Page2");ws2.PageSetup.PageOrientation=XLPageOrientation.Portrait;ws2.PageSetup.FitToPages(2,2);// Alternatively you can use// ws2.PageSetup.PagesTall = #// and/or ws2.PageSetup.PagesWide = #ws2.PageSetup.PaperSize=XLPaperSize.LetterPaper;ws2.PageSetup.VerticalDpi=600;ws2.PageSetup.HorizontalDpi=600;ws2.PageSetup.FirstPageNumber=5;workbook.SaveAs("PageTab.xlsx");
For more information on the paper size enumeration please see thePaper Size Lookup Table
- How do I deliver an Excel file in ASP.NET?
- Does it support Excel 2003 and prior formats (.xls)?
- How can I insert an image?
- Text with numbers are getting converted to numbers, what's up with that?
- How do I get the result of a formula?
- Data Types
- Creating Multiple Worksheets
- Organizing Sheets
- Loading and Modifying Files
- Using Lambda Expressions
- Cell Values
- Workbook Properties
- Using Formulas
- Evaluating Formulas
- Creating Rows And Columns Outlines
- Hide Unhide Rows And Columns
- Freeze Panes
- Copying Worksheets
- Using Hyperlinks
- Data Validation
- Hide Worksheets
- Sheet Protection
- Tab Colors
- Conditional Formatting
- Pivot Table example
- Sparklines
- Copying IEnumerable Collections
- Inserting Data
- Inserting Tables
- Adding DataTable as Worksheet
- Adding DataSet
- Styles - Alignment
- Styles - Border
- Styles - Fill
- Styles - Font
- Styles - NumberFormat
- NumberFormatId Lookup Table
- Style Worksheet
- Style Rows and Columns
- Using Default Styles
- Using Colors
- ClosedXML Predefined Colors
- Excel Indexed Colors
- Using Rich Text
- Using Phonetics
- Defining Ranges
- Merging Cells
- Clearing Ranges
- Deleting Ranges
- Multiple Ranges
- Shifting Ranges
- Transpose Ranges
- Named Ranges
- Accessing Named Ranges
- Copying Ranges
- Using Tables
- Sorting Data
- Selecting Cells and Ranges
- Row Height and Styles
- Selecting Rows
- Inserting Rows
- Inserting and Deleting Rows
- Adjust Row Height and Column Width to Contents
- Row Cells
- Column Width and Styles
- Selecting Columns
- Inserting Columns
- Inserting and Deleting Columns
- Adjust Row Height and Column Width to Contents
- Column Cells
- Pages Tab
- Paper Size Lookup Table
- Margins Tab
- Headers and Footers Tab
- Sheet Tab
- Print Areas and Page Breaks