Home     Products      Support      Corporate     Sign In 

Support Knowledge Base, Article 993

Product
ExcelWriter
Version
6.x
Title
Setting Page Breaks in ExcelWriter
Problem
Can I add or remove page breaks using ExcelWriter?
Solution

ExcelWriter supports in the insertion of horizontal and vertical page breaks within a Worksheet using the ExcelApplication class/object. It does not, however, support the deletion or modification of existing page breaks.

Horizontal page breaks

To insert a horizontal page break, use one of the following methods:

ExcelApplication platform Method
.NET or Java Worksheet.InsertHorizontalPageBreak(Cell afterCell)
COM/ASP * SACells.HPageBreak(Cell As SACell)

* Includes SAExcelApplicationDotNet wrapper class used in ASP.NET

Vertical page breaks

To insert a vertical page break, use one of the following methods:

ExcelApplication platform Method
.NET or Java Worksheet.InsertVerticalPageBreak(Cell rightOfCell)
COM/ASP * SACells.VPageBreak(Cell As SACell)

* Includes SAExcelApplicationDotNet wrapper class used in ASP.NET

Examples

The following examples demonstrate inserting a horizontal page break and a vertical page break.

[C#] [VB.NET] [Java] [COM/ASP]  
//--- The following namespace has been imported:
//---   SoftArtisans.OfficeWriter.ExcelWriter

//--- Instantiate ExcelApplication and create a new Workbook
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
Worksheet sheet1 = wb.Worksheets[0];

//--- Insert horizontal page break below cell A15
sheet1.InsertHorizontalPageBreak(sheet1.Cells["A15"]);

//--- Insert vertical page break to the right of cell H1
sheet1.InsertVerticalPageBreak(sheet1.Cells["H1"]);

//--- Save Workbook
xla.Save(wb, Response, "out.xls", false);

Related Links
OfficeWriter Home Page
Purchase OfficeWriter
OfficeWriter Enterprise Edition
Latest OfficeWriter News
OfficeWriter: Programmatic Runtime Control

Created : 8/28/2006 11:13:12 AM (last modified : 8/28/2006 3:35:39 PM)

Rate this article!

 
Comments



Copyright 2006 © SoftArtisans, Inc. All Rights Reserved.

Site Map     |     Privacy Policy     |     Contact Us