Class PageSetupImpl
This Class allows the user to configure Print settings of a document.
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation
Assembly: Syncfusion.XlsIO.UWP.dll
Syntax
public class PageSetupImpl : PageSetupBaseImpl, IDisposable, IBiffStorage, IPageSetup, IPageSetupBase, IParentApplication
Constructors
PageSetupImpl(IApplication, Object)
Sets application and parent fields.
Declaration
public PageSetupImpl(IApplication application, object parent)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the page setup. |
System.Object | parent | Parent object for the page setup. |
PageSetupImpl(IApplication, Object, BiffRecordRaw[], Int32)
Recovers Page setup from the Biff Records array starting from position
Declaration
public PageSetupImpl(IApplication application, object parent, BiffRecordRaw[] data, int position)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the page setup. |
System.Object | parent | Parent object for the page setup. |
Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw[] | data | Array of Biff Records that contains all needed records. |
System.Int32 | position | Position of PrintHeadersRecord in the array. |
PageSetupImpl(IApplication, Object, BiffReader)
Recovers page setup from the stream and sets its Application and Parent fields. Current record in the stream must be PrintHeadersRecord.
Declaration
public PageSetupImpl(IApplication application, object parent, BiffReader reader)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the page setup. |
System.Object | parent | Parent object for the page setup. |
BiffReader | reader | BiffReader that contains page setup records. |
PageSetupImpl(IApplication, Object, List<BiffRecordRaw>, Int32)
Recovers Page setup from the Biff Records List starting from position.
Declaration
public PageSetupImpl(IApplication application, object parent, List<BiffRecordRaw> data, int position)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the page setup. |
System.Object | parent | Parent object for the page setup. |
System.Collections.Generic.List<Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw> | data | List which contains Biff Records. |
System.Int32 | position | Position of PrintHeadersRecord in the array. |
Properties
DefaultRowHeight
Gets / sets default row height.
Declaration
public int DefaultRowHeight { get; set; }
Property Value
Type |
---|
System.Int32 |
DefaultRowHeightFlag
Gets / sets default row height option flag.
Declaration
public bool DefaultRowHeightFlag { get; set; }
Property Value
Type |
---|
System.Boolean |
HPageBreaks
Gets horizontal page break.
Declaration
public HPageBreaksCollection HPageBreaks { get; }
Property Value
Type |
---|
HPageBreaksCollection |
IsFitToPage
Indicates whether fit to page mode is selected.
Declaration
public override bool IsFitToPage { get; set; }
Property Value
Type |
---|
System.Boolean |
Overrides
IsSummaryColumnRight
Indicates whether summary columns will appear right of the detail in outlines.
Declaration
public bool IsSummaryColumnRight { get; set; }
Property Value
Type |
---|
System.Boolean |
IsSummaryRowBelow
Indicates whether summary rows will appear below detail in outlines.
Declaration
public bool IsSummaryRowBelow { get; set; }
Property Value
Type |
---|
System.Boolean |
PrintArea
Returns or sets the range to be printed, as a string using A1-style references in the language of the macro. Read/write String.
Declaration
public string PrintArea { get; set; }
Property Value
Type |
---|
System.String |
PrintGridlines
True if cell gridlines are printed on the page. Applies only to worksheets. Read/write Boolean.
Declaration
public bool PrintGridlines { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
To know more about page settings refer this link.
Examples
The following code illustrates the use of PrintGridlines property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1:M20"].Text = "PagePrint";
sheet.Range["A1:M1"].Text = "Page";
sheet.Range["C1:C20"].Text = "Page";
//True to cell gridlines are printed on the page
sheet.PageSetup.PrintGridlines = true;
workbook.SaveAs("PageSetup.xlsx");
workbook.Close();
}
PrintHeadings
True if row and column headings are printed with this page. Applies only to worksheets. Read/write Boolean.
Declaration
public bool PrintHeadings { get; set; }
Property Value
Type |
---|
System.Boolean |
PrintTitleColumns
Returns or sets the columns that contain the cells to be repeated on the left side of each page, as a string in A1-style notation in the language of the macro. Read/write String.
Declaration
public string PrintTitleColumns { get; set; }
Property Value
Type |
---|
System.String |
PrintTitleRows
Returns or sets the rows that contain the cells to be repeated at the top of each page, as a string in A1-style notation in the language of the macro. Read/write String.
Declaration
public string PrintTitleRows { get; set; }
Property Value
Type |
---|
System.String |
RelationId
Gets / sets relation id to the printer settings part.
Declaration
public string RelationId { get; set; }
Property Value
Type |
---|
System.String |
VPageBreaks
Gets vertical page break.
Declaration
public VPageBreaksCollection VPageBreaks { get; }
Property Value
Type |
---|
VPageBreaksCollection |
Worksheet
Returns parent worksheet. Read-only.
Declaration
public WorksheetImpl Worksheet { get; }
Property Value
Type |
---|
WorksheetImpl |
Methods
Clone(Object)
Creates copy of the current instance.
Declaration
public PageSetupImpl Clone(object parent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parent | Parent for the new instance. |
Returns
Type | Description |
---|---|
PageSetupImpl | A clone of the current instance. |
ConvertTo3dRangeName(String)
Converts cell range to 3d Range name.
Declaration
protected string ConvertTo3dRangeName(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | cell range. |
Returns
Type | Description |
---|---|
System.String | 3d range name. |
Dispose()
Dispose Page Setup
Declaration
public override void Dispose()
Overrides
ExtractPrintArea()
Extracts print area string.
Declaration
protected string ExtractPrintArea()
Returns
Type | Description |
---|---|
System.String | Print area string. |
ExtractPrintTitleRowColumn(Boolean)
Extracts row or column print title from default title named range.
Declaration
protected string ExtractPrintTitleRowColumn(bool bRowExtract)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | bRowExtract | Defines which print title must be extracted. |
Returns
Type | Description |
---|---|
System.String | Row/column print title string. |
FillGutsRecord()
Fills internal guts record with information from Rows and ColumnInfo records.
Declaration
protected void FillGutsRecord()
FillStreamStart(BinaryWriter, DataProvider, IEncryptor, Int32)
Fills stream with some records before main page setup records.
Declaration
protected override int FillStreamStart(BinaryWriter writer, DataProvider provider, IEncryptor encryptor, int streamPosition)
Parameters
Type | Name | Description |
---|---|---|
System.IO.BinaryWriter | writer | Writer to write records into. |
DataProvider | provider | Object that gives access to the temporary buffer. |
IEncryptor | encryptor | Object to encrypt data. |
System.Int32 | streamPosition | Position in the output stream. Used to increase performance. |
Returns
Type | Description |
---|---|
System.Int32 | Size of the serialized data. |
Overrides
FindParents()
Find parent worksheet.
Declaration
protected override void FindParents()
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | When can't find parent worksheet. |
GetAddressGlobalWithoutName(Ptg[])
Returns global address without sheet name.
Declaration
protected string GetAddressGlobalWithoutName(Ptg[] token)
Parameters
Type | Name | Description |
---|---|---|
Ptg[] | token | Formula token. |
Returns
Type | Description |
---|---|
System.String | Global address without sheet name. |
GetStoreSize(ExcelVersion)
Size of the required storage space. Read-only.
Declaration
public override int GetStoreSize(ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
ExcelVersion | version | Represents Excel version. |
Returns
Type |
---|
System.Int32 |
Overrides
Parse(BiffReader)
Recovers page setup from the stream, first record must be PrintHeadersRecord.
Declaration
public void Parse(BiffReader reader)
Parameters
Type | Name | Description |
---|---|---|
BiffReader | reader | Stream that contains all needed records. |
ParsePrintAreaExpression(String)
Parses print area expression.
Declaration
protected void ParsePrintAreaExpression(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Value representing print area. |
ParsePrintTitleColumns(String)
Parses column print title string and makes appropriate changes to default title named range.
Declaration
protected void ParsePrintTitleColumns(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Column print title string to set. |
ParsePrintTitleRows(String)
Parses row print title string and makes appropriate changes to default title named range.
Declaration
protected void ParsePrintTitleRows(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | Row print title string to set. |
ParseRecord(BiffRecordRaw)
Parses record.
Declaration
protected override bool ParseRecord(BiffRecordRaw record)
Parameters
Type | Name | Description |
---|---|---|
Syncfusion.XlsIO.Parser.Biff_Records.BiffRecordRaw | record | Record to parse. |
Returns
Type | Description |
---|---|
System.Boolean | True if record was successfully parsed, false otherwise. |
Overrides
SerializeStartRecords(OffsetArrayList)
Serializes some records before main page setup block.
Declaration
protected override void SerializeStartRecords(OffsetArrayList records)
Parameters
Type | Name | Description |
---|---|---|
OffsetArrayList | records | OffsetArrayList to serialize into. |