Interface IVPageBreak
Represents a vertical page break. The VPageBreak object is a member of the VPageBreaks collection.
Namespace: Syncfusion.XlsIO
Assembly: Syncfusion.XlsIO.UWP.dll
Syntax
public interface IVPageBreak
Properties
Application
Used without an object qualifier, this property returns an IApplication object that represents the Excel IApplication.
Declaration
IApplication Application { get; }
Property Value
Type |
---|
IApplication |
Examples
The following code illustrates how to access the IApplication property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
IWorksheet sheet = workbook.Worksheets[0];
//Get Page break with corresponding column
IVPageBreak vPageBrk = sheet.VPageBreaks.GetPageBreak(5);
//property returns an Application object that represents the Microsoft Excel application
IApplication vPageBreakApplication = vPageBrk.Application;
object vPageBreakParent = vPageBrk.Parent;
workbook.SaveAs("PageSetup.xlsx");
workbook.Close();
}
Location
For the HPageBreak and VPageBreak objects, this property returns or sets the cell (a Range object) that defines the page-break location. Horizontal page breaks are aligned with the top edge of the location cell; vertical page breaks are aligned with the left edge of the location cell. Read / write IRange.
Declaration
IRange Location { get; set; }
Property Value
Type |
---|
IRange |
Remarks
To know more about page setting refer this link.
Examples
The following code illustrates the use of Location property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
IWorksheet sheet = workbook.Worksheets[0];
//Get Page break with corresponding column
IVPageBreak vPageBrk = sheet.VPageBreaks.GetPageBreak(5);
//Get the IRange Location
IRange range = vPageBrk.Location;
//Set the IRange Location
vPageBrk.Location = sheet.Range["F1:S10"];
workbook.SaveAs("PageSetup.xlsx");
workbook.Close();
}
Parent
Returns the parent object for the specified object.
Declaration
object Parent { get; }
Property Value
Type |
---|
System.Object |
Examples
The following code illustrates the use of Parent property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Open("Sample.xlsx");
IWorksheet sheet = workbook.Worksheets[0];
//Get Page break with corresponding row
IVPageBreak vPageBrk = sheet.VPageBreaks.GetPageBreak(5);
//The parent object for the specified object
object vPageBreakParent = vPageBrk.Parent;
workbook.SaveAs("PageSetup.xlsx");
workbook.Close();
}