Worksheet Class

PicoXLSX

PicoXLSX

Worksheet Class

Class representing a worksheet of a workbook
Inheritance Hierarchy
SystemObject  PicoXLSXWorksheet

Namespace:  PicoXLSX
Assembly:  PicoXLSX (in PicoXLSX.dll) Version: 2.4.0.0 (2.4.0)
Syntax
C#
public class Worksheet

The Worksheet type exposes the following members.

Constructors
  NameDescription
Public methodWorksheet
Default Constructor
Public methodWorksheet(String, Int32, Workbook)
Constructor with name and sheet ID
Top
Properties
  NameDescription
Public propertyAutoFilterRange
Gets the range of the auto-filter. Wrapped to Nullable to provide null as value. If null, no auto-filter is applied
Public propertyCells
Gets the cells of the worksheet as dictionary with the cell address as key and the cell object as value
Public propertyColumns
Gets all columns with non-standard properties, like auto filter applied or a special width as dictionary with the zero-based column index as key and the column object as value
Public propertyCurrentCellDirection
Gets or sets the direction when using AddNextCell method
Public propertyDefaultColumnWidth
Gets or sets the default column width
Public propertyDefaultRowHeight
Gets or sets the default Row height
Public propertyHiddenRows
Gets the hidden rows as dictionary with the zero-based row number as key and a boolean as value. True indicates hidden, false visible.
Public propertyMergedCells
Gets the merged cells (only references) as dictionary with the cell address as key and the range object as value
Public propertyRowHeights
Gets defined row heights as dictionary with the zero-based row number as key and the height (float from 0 to 409.5) as value
Public propertySelectedCells
Gets the cell range of selected cells of this worksheet. Null if no cells are selected
Public propertySheetID
Gets or sets the internal ID of the sheet
Public propertySheetName
Gets or sets the name of the worksheet
Public propertySheetProtectionPassword
Gets the password used for sheet protection
Public propertySheetProtectionValues
Gets the list of SheetProtectionValues. These values define the allowed actions if the worksheet is protected
Public propertyUseSheetProtection
Gets or sets whether the worksheet is protected. If true, protection is enabled
Public propertyWorkbookReference
Gets or sets the Reference to the parent Workbook
Top
Methods
  NameDescription
Public methodAddAllowedActionOnSheetProtection
Method to add allowed actions if the worksheet is protected. If one or more values are added, UseSheetProtection will be set to true
Public methodAddCell(Object, String)
Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Public methodAddCell(Object, Int32, Int32)
Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Public methodAddCell(Object, String, Style)
Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Public methodAddCell(Object, Int32, Int32, Style)
Adds an object to the defined cell address. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Public methodAddCellFormula(String, String)
Adds a cell formula as string to the defined cell address
Public methodAddCellFormula(String, Int32, Int32)
Adds a cell formula as string to the defined cell address
Public methodAddCellFormula(String, String, Style)
Adds a cell formula as string to the defined cell address
Public methodAddCellFormula(String, Int32, Int32, Style)
Adds a cell formula as string to the defined cell address
Public methodAddCellRange(ListObject, String)
Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
Public methodAddCellRange(ListObject, CellAddress, CellAddress)
Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
Public methodAddCellRange(ListObject, String, Style)
Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
Public methodAddCellRange(ListObject, CellAddress, CellAddress, Style)
Adds a list of object values to a defined cell range. If the type of the a particular value does not match with one of the supported data types, it will be casted to a String. Prepared objects of the type Cell will not be casted but adjusted
Private methodAddCellRangeInternalT
Internal function to add a generic list of value to the defined cell range
Public methodAddHiddenColumn(Int32)
Sets the defined column as hidden
Public methodAddHiddenColumn(String)
Sets the defined column as hidden
Public methodAddHiddenRow
Sets the defined row as hidden
Public methodAddNextCell(Object)
Adds an object to the next cell position. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Public methodAddNextCell(Object, Style)
Adds an object to the next cell position. If the type of the value does not match with one of the supported data types, it will be casted to a String. A prepared object of the type Cell will not be casted but adjusted
Private methodAddNextCell(Cell, Boolean, Style)
Method to insert a generic cell to the next cell position
Public methodAddNextCellFormula(String)
Adds a formula as string to the next cell position
Public methodAddNextCellFormula(String, Style)
Adds a formula as string to the next cell position
Private methodCastValue
Method to cast a value or align an object of the type Cell to the context of the worksheet
Public methodClearActiveStyle
Clears the active style of the worksheet. All later added calls will contain no style unless another active style is set
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetCell(CellAddress)
Gets the cell of the specified address
Public methodGetCell(Int32, Int32)
Gets the cell of the specified column and row number (zero-based)
Public methodGetCurrentColumnNumber
Gets the current column number (zero based)
Public methodGetCurrentRowNumber
Gets the current row number (zero based)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Private methodGetLastAddress
Gets the last existing row or column number of the current worksheet (zero-based)
Public methodGetLastColumnNumber
Gets the last existing column number in the current worksheet (zero-based)
Public methodGetLastRowNumber
Gets the last existing row number in the current worksheet (zero-based)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGoToNextColumn
Moves the current position to the next column
Public methodGoToNextColumn(Int32)
Moves the current position to the next column with the number of cells to move
Public methodGoToNextRow
Moves the current position to the next row (use for a new line)
Public methodGoToNextRow(Int32)
Moves the current position to the next row with the number of cells to move (use for a new line)
Public methodHasCell(CellAddress)
Gets whether the specified address exists in the worksheet. Existing means that a value was stored at the address
Public methodHasCell(Int32, Int32)
Gets whether the specified address exists in the worksheet. Existing means that a value was stored at the address
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodMergeCells(String)
Merges the defined cell range
Public methodMergeCells(CellRange)
Merges the defined cell range
Public methodMergeCells(CellAddress, CellAddress)
Merges the defined cell range
Public methodRecalculateAutoFilter
Method to recalculate the auto filter (columns) of this worksheet. This is an internal method. There is no need to use it. It must be public to require access from the LowLevel class
Public methodRecalculateColumns
Method to recalculate the collection of columns of this worksheet. This is an internal method. There is no need to use it. It must be public to require access from the LowLevel class
Public methodRemoveAutoFilter
Removes auto filters from the worksheet
Public methodRemoveCell(String)
Removes a previous inserted cell at the defined address
Public methodRemoveCell(Int32, Int32)
Removes a previous inserted cell at the defined address
Public methodRemoveHiddenColumn(Int32)
Sets a previously defined, hidden column as visible again
Public methodRemoveHiddenColumn(String)
Sets a previously defined, hidden column as visible again
Public methodRemoveHiddenRow
Sets a previously defined, hidden row as visible again
Public methodRemoveMergedCells
Removes the defined merged cell range
Public methodRemoveSelectedCells
Removes the cell selection of this worksheet
Public methodStatic memberSanitizeWorksheetName
Sanitizes a worksheet name
Public methodSetActiveStyle
Sets the active style of the worksheet. This style will be assigned to all later added cells
Public methodSetAutoFilter(String)
Sets the column auto filter within the defined column range
Public methodSetAutoFilter(Int32, Int32)
Sets the column auto filter within the defined column range
Private methodSetColumnHiddenState
Sets the defined column as hidden or visible
Public methodSetColumnWidth(Int32, Single)
Sets the width of the passed column number (zero-based)
Public methodSetColumnWidth(String, Single)
Sets the width of the passed column address
Public methodSetCurrentCellAddress(String)
Set the current cell address
Public methodSetCurrentCellAddress(Int32, Int32)
Set the current cell address
Public methodSetCurrentColumnNumber
Sets the current column number (zero based)
Public methodSetCurrentRowNumber
Sets the current row number (zero based)
Public methodSetRowHeight
Sets the height of the passed row number (zero-based)
Private methodSetRowHiddenState
Sets the defined row as hidden or visible
Public methodSetSelectedCells(String)
Sets the selected cells on this worksheet
Public methodSetSelectedCells(CellRange)
Sets the selected cells on this worksheet
Public methodSetSelectedCells(CellAddress, CellAddress)
Sets the selected cells on this worksheet
Public methodSetSheetname
Validates and sets the worksheet name
Public methodSetSheetName
Sets the name of the sheet
Public methodSetSheetProtectionPassword
Sets or removes the password for worksheet protection. If set, UseSheetProtection will be also set to true
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Private methodStatic memberWorksheetExists
Checks whether a worksheet with the given name exists
Top
Fields
  NameDescription
Public fieldStatic memberDEFAULT_COLUMN_WIDTH
Default column width as constant
Public fieldStatic memberDEFAULT_ROW_HEIGHT
Default row height as constant
Public fieldStatic memberMAX_COLUMN_NUMBER
Maximum column number (zero-based) as constant
Public fieldStatic memberMAX_COLUMN_WIDTH
Maximum column width as constant
Public fieldStatic memberMAX_ROW_HEIGHT
Maximum row height as constant
Public fieldStatic memberMAX_ROW_NUMBER
Maximum row number (zero-based) as constant
Public fieldStatic memberMIN_COLUMN_NUMBER
Minimum column number (zero-based) as constant
Public fieldStatic memberMIN_COLUMN_WIDTH
Minimum column width as constant
Public fieldStatic memberMIN_ROW_HEIGHT
Minimum row height as constant
Public fieldStatic memberMIN_ROW_NUMBER
Minimum row number (zero-based) as constant
Top
See Also