Class XlsWorksheetBase
- Namespace
- Spire.Xls.Core.Spreadsheet
- Assembly
- Spire.XLS.dll
public abstract class XlsWorksheetBase : XlsObject, IDisposable, INamedObject, ITabSheet, IExcelApplication, ICloneParent
- Inheritance
-
XlsWorksheetBase
- Implements
- Derived
- Inherited Members
Fields
DEF_MIN_COLUMN_INDEX
public const int DEF_MIN_COLUMN_INDEX = 2147483647
Field Value
m_book
protected XlsWorkbook m_book
Field Value
m_iFirstColumn
[CLSCompliant(false)]
protected int m_iFirstColumn
Field Value
m_iFirstRow
protected int m_iFirstRow
Field Value
m_iLastColumn
[CLSCompliant(false)]
protected int m_iLastColumn
Field Value
m_iLastRow
protected int m_iLastRow
Field Value
Properties
ArcShapes
public IArcShapes ArcShapes { get; }
Property Value
ButtonShapes
public IButtonShapes ButtonShapes { get; }
Property Value
CellImages
public ExcelPicture[] CellImages { get; }
Property Value
Charts
public IChartShapes Charts { get; }
Property Value
CheckBoxes
public ICheckBoxes CheckBoxes { get; }
Property Value
CodeName
Name used by macros to access workbook items.
public string CodeName { get; set; }
Property Value
ComboBoxes
public IComboBoxes ComboBoxes { get; }
Property Value
Comments
public IComments Comments { get; }
Property Value
DefaultGridlineColor
Indicates whether gridline color has default value.
public bool DefaultGridlineColor { get; }
Property Value
FirstColumn
Gets or sets index of the first column of the worksheet.
[CLSCompliant(false)]
public virtual int FirstColumn { get; set; }
Property Value
FirstDataColumn
Gets index of the first data column of the worksheet.
public int FirstDataColumn { get; }
Property Value
FirstDataRow
Gets index of the first data row of the worksheet.
public int FirstDataRow { get; }
Property Value
FirstRow
Gets / sets index of the first row of the worksheet.
public virtual int FirstRow { get; set; }
Property Value
GridLineColor
Grid line color.
//Create worksheet
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
//Set grid lines color
worksheet.GridLineColor = ExcelColors.Red;
//Save to file
workbook.SaveToFile("GridLineColor.xlsx");
public ExcelColors GridLineColor { get; set; }
Property Value
GroupBoxes
public IGroupBoxes GroupBoxes { get; }
Property Value
GroupShapeCollection
Get group shapes in worksheet.
public GroupShapeCollection GroupShapeCollection { get; }
Property Value
HasPictures
public bool HasPictures { get; }
Property Value
HasVmlShapes
Indicates whether worksheet has vml shapes. Read-only.
public bool HasVmlShapes { get; }
Property Value
HeaderFooterShapes
Header / footer shapes collection.
public XlsHeaderFooterShapeCollection HeaderFooterShapes { get; }
Property Value
Index
Returns the index number of the object within the collection of objects.
public int Index { get; set; }
Property Value
IsPasswordProtected
public bool IsPasswordProtected { get; }
Property Value
IsRightToLeft
Indicates whether worksheet is displayed right to left.
public bool IsRightToLeft { get; set; }
Property Value
IsRowColHeadersVisible
Gets or sets whether the worksheet will display row and column headers. Default is true.
public bool IsRowColHeadersVisible { get; set; }
Property Value
IsSelected
Indicates whether tab of this sheet is selected. Read-only.
public bool IsSelected { get; }
Property Value
IsTransitionEvaluation
public bool IsTransitionEvaluation { get; set; }
Property Value
LabelShapes
public ILabelShapes LabelShapes { get; }
Property Value
LastColumn
Gets or sets index of the last column of the worksheet.
[CLSCompliant(false)]
public int LastColumn { get; set; }
Property Value
LastDataColumn
Gets index of the last data column of the worksheet.
public int LastDataColumn { get; }
Property Value
LastDataRow
Gets index of the last data row of the worksheet.
public int LastDataRow { get; }
Property Value
LastRow
Gets or sets one-based index of the last row of the worksheet.
public virtual int LastRow { get; set; }
Property Value
LeftVisibleColumn
Gets/sets left visible column of the worksheet.
//Create worksheet
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
//Set left visible column
worksheet.LeftVisibleColumn = 3;
//Get left visible column
Console.Write(worksheet.LeftVisibleColumn);
//Save to file
workbook.SaveToFile("LeftVisibleColumn.xlsx");
public int LeftVisibleColumn { get; set; }
Property Value
Lines
public ILines Lines { get; }
Property Value
ListBoxes
public IListBoxes ListBoxes { get; }
Property Value
Name
Returns or sets the name of the object. Read / write String.
public string Name { get; set; }
Property Value
OvalShapes
public IOvalShapes OvalShapes { get; }
Property Value
ParentWorkbook
public XlsWorkbook ParentWorkbook { get; }
Property Value
Pictures
Pictures collection. Read-only.
public IPictures Pictures { get; }
Property Value
ProtectContents
Indicates is current sheet is protected.
public virtual bool ProtectContents { get; }
Property Value
ProtectDrawingObjects
True if objects are protected. Read only.
public virtual bool ProtectDrawingObjects { get; }
Property Value
ProtectScenarios
True if the scenarios of the current sheet are protected. Read only.
public virtual bool ProtectScenarios { get; }
Property Value
Protection
public virtual SheetProtectionType Protection { get; }
Property Value
PrstGeomShapes
public PrstGeomShapeCollection PrstGeomShapes { get; }
Property Value
QueryTables
public QueryTableCollection QueryTables { get; }
Property Value
RadioButtons
public IRadioButtons RadioButtons { get; }
Property Value
RealIndex
public int RealIndex { get; set; }
Property Value
RectangleShapes
public IRectangleShapes RectangleShapes { get; }
Property Value
ScrollBarShapes
public IScrollBarShapes ScrollBarShapes { get; }
Property Value
Shapes
Shapes collection.
public IShapes Shapes { get; }
Property Value
SheetId
Gets or sets sheetId for this sheet.
public int SheetId { get; set; }
Property Value
SpinnerShapes
public ISpinnerShapes SpinnerShapes { get; }
Property Value
TabColor
Tab color.
public virtual Color TabColor { get; set; }
Property Value
TabColorObject
public virtual OColor TabColorObject { get; }
Property Value
TabKnownColor
Tab excel color.
public virtual ExcelColors TabKnownColor { get; set; }
Property Value
TextBoxes
Returns inner textboxes collection. Read-only.
public ITextBoxes TextBoxes { get; }
Property Value
TopVisibleRow
Gets/sets top visible row of the worksheet.
//Create worksheet
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
//Set top visible row
worksheet.TopVisibleRow = 5;
//Get top visible row
Console.Write(worksheet.TopVisibleRow);
//Save to file
workbook.SaveToFile("TopVisibleRow.xlsx");
public int TopVisibleRow { get; set; }
Property Value
TypedArcs
public ArcShapeCollection TypedArcs { get; }
Property Value
TypedButtons
Returns inner buttons collection. Read-only.
public ButtonShapeCollection TypedButtons { get; }
Property Value
TypedCheckBoxes
public CheckBoxCollection TypedCheckBoxes { get; }
Property Value
TypedComboBoxes
public ComboBoxCollection TypedComboBoxes { get; }
Property Value
TypedGroupBoxes
Returns inner gourpboxes collection. Read-only.
public GroupBoxCollection TypedGroupBoxes { get; }
Property Value
TypedLabels
Returns inner labels collection. Read-only.
public LabelShapeCollection TypedLabels { get; }
Property Value
TypedLines
Returns inner lines collection. Read-only.
public LineCollection TypedLines { get; }
Property Value
TypedListBoxes
Returns inner listboxes collection. Read-only.
public ListBoxCollection TypedListBoxes { get; }
Property Value
TypedOvals
Returns inner ovals collection. Read-only.
public OvalShapeCollection TypedOvals { get; }
Property Value
TypedPictures
Returns inner pictures collection. Read-only.
public PicturesCollection TypedPictures { get; }
Property Value
TypedRadioButtons
public RadioButtonCollection TypedRadioButtons { get; }
Property Value
TypedRects
Returns inner rects collection. Read-only.
public RectangleCollection TypedRects { get; }
Property Value
TypedScollBars
Returns inner scollbars collection. Read-only.
public ScrollBarCollection TypedScollBars { get; }
Property Value
TypedSpinners
Returns inner spinners collection. Read-only.
public SpinnerShapeCollection TypedSpinners { get; }
Property Value
TypedTextBoxes
Returns inner textboxes collection. Read-only.
public TextBoxCollection TypedTextBoxes { get; }
Property Value
UnknownVmlShapes
Indicates whether worksheet contains some unknown vml shapes.
public bool UnknownVmlShapes { get; set; }
Property Value
Visibility
Controls end user visibility of worksheet.
public WorksheetVisibility Visibility { get; set; }
Property Value
VmlShapesCount
public int VmlShapesCount { get; }
Property Value
Workbook
public IWorkbook Workbook { get; }
Property Value
Zoom
Zoom factor of document.
public virtual int Zoom { get; set; }
Property Value
Remarks
Value of zoom should be between 10 and 400.
Methods
Activate()
Makes the current sheet the active sheet. Equivalent to clicking the sheet's tab in MS Excel.
public virtual void Activate()
AddTextEffectShape(PresetTextEffect, string, int, int, int, int, int, int)
public IShape AddTextEffectShape(PresetTextEffect effect, string text, int upperLeftRow, int top, int upperLeftColumn, int left, int height, int width)
Parameters
effect
PresetTextEffecttext
stringupperLeftRow
inttop
intupperLeftColumn
intleft
intheight
intwidth
int
Returns
Clone(object)
[Obsolete("the method is not implemented")]
public virtual object Clone(object parent)
Parameters
parent
object
Returns
InitializeCollections()
protected virtual void InitializeCollections()
MoveSheet(int)
Moves sheet into new position, including chartsheet and worksheet.
public void MoveSheet(int destIndex)
Parameters
destIndex
intDestination index.
Protect(string)
Protects worksheet with password.protect the sheet except select lock/unlock cells.
//Create worksheet
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
//Protects the first worksheet's content with password
worksheet.Protect("123456");
//Save to file
workbook.SaveToFile("Protect.xlsx");
public void Protect(string password)
Parameters
password
stringProtection password.
Remarks
Password should be less than 15 symbols.
Protect(string, SheetProtectionType)
Protects worksheet with password.
public void Protect(string password, SheetProtectionType options)
Parameters
password
stringProtection password.
options
SheetProtectionType
Remarks
Password should be less than 15 symbols.
Select()
public virtual void Select()
SelectTab()
public void SelectTab()
SetChanged()
public void SetChanged()
Unprotect()
Unprotects this wokrsheet.
public void Unprotect()
Unprotect(string)
Unprotects this worksheet using specified password.
public void Unprotect(string password)
Parameters
password
stringPassword to unprotect.
Unselect()
public void Unselect()
Unselect(bool)
public void Unselect(bool Check)
Parameters
Check
bool