This project has moved. For the latest updates, please go here.

Print Areas and Page Breaks

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");

Last edited Sep 24, 2010 at 6:33 AM by MDeLeon, version 4