Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 645 Bytes

Print-Areas-and-Page-Breaks.md

File metadata and controls

23 lines (17 loc) · 645 Bytes

Separate Print Areas

SeparatePrintAreas.jpg

var workbook = new XLWorkbook();
var ws1 = workbook.Worksheets.Add("Separate PrintAreas");
ws1.PageSetup.PrintAreas.Add("A1:B2");
ws1.PageSetup.PrintAreas.Add("D3:D5");

Page Breaks

PageBreaks.jpg

var ws2 = workbook.Worksheets.Add("Page Breaks");
ws2.PageSetup.PrintAreas.Add("A1:D5");
ws2.PageSetup.AddHorizontalPageBreak(2);
ws2.PageSetup.AddVerticalPageBreak(2);

workbook.SaveAs("PrintAreas.xlsx");