|
NanoXLSX.Core 3.0.0-rc.3
|
Class representing a worksheet of a workbook. More...
Public Types | |
| enum | CellDirection { ColumnToColumn , RowToRow , Disabled } |
| Enum to define the direction when using AddNextCell method. More... | |
| enum | SheetProtectionValue { Objects , Scenarios , FormatCells , FormatColumns , FormatRows , InsertColumns , InsertRows , InsertHyperlinks , DeleteColumns , DeleteRows , SelectLockedCells , Sort , AutoFilter , PivotTables , SelectUnlockedCells } |
| Enum to define the possible protection types when protecting a worksheet. More... | |
| enum | WorksheetPane { BottomRight , TopRight , BottomLeft , TopLeft } |
| Enum to define the pane position or active pane in a slip worksheet. More... | |
| enum | SheetViewType { Normal , PageBreakPreview , PageLayout } |
| Enum to define how a worksheet is displayed in the spreadsheet application (Excel). More... | |
Public Member Functions | |
| Worksheet () | |
| Default Constructor. | |
| Worksheet (string name) | |
| Constructor with worksheet name. | |
| Worksheet (string name, int id, Workbook reference) | |
| Constructor with name and sheet ID. | |
| void | AddNextCell (object value) |
| 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 cast to a String. A prepared object of the type Cell will not be cast but adjusted. | |
| void | AddNextCell (object value, Style 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 cast to a String. A prepared object of the type Cell will not be cast but adjusted. | |
| void | AddCell (object value, int columnNumber, int rowNumber) |
| 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 cast to a String. A prepared object of the type Cell will not be cast but adjusted. | |
| void | AddCell (object value, int columnNumber, int rowNumber, Style 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 cast to a String. A prepared object of the type Cell will not be cast but adjusted. | |
| void | AddCell (object value, string address) |
| 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 cast to a String. A prepared object of the type Cell will not be cast but adjusted. | |
| void | AddCell (object value, string address, Style 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 cast to a String. A prepared object of the type Cell will not be cast but adjusted. | |
| void | AddCellFormula (string formula, string address) |
| Adds a cell formula as string to the defined cell address. | |
| void | AddCellFormula (string formula, string address, Style style) |
| Adds a cell formula as string to the defined cell address. | |
| void | AddCellFormula (string formula, int columnNumber, int rowNumber) |
| Adds a cell formula as string to the defined cell address. | |
| void | AddCellFormula (string formula, int columnNumber, int rowNumber, Style style) |
| Adds a cell formula as string to the defined cell address. | |
| void | AddNextCellFormula (string formula) |
| Adds a formula as string to the next cell position. | |
| void | AddNextCellFormula (string formula, Style style) |
| Adds a formula as string to the next cell position. | |
| void | AddCellRange (IReadOnlyList< object > values, Address startAddress, Address endAddress) |
| Adds a list of object values to a defined cell range. If the type of the particular value does not match with one of the supported data types, it will be cast to a String. Prepared objects of the type Cell will not be cast but adjusted. | |
| void | AddCellRange (IReadOnlyList< object > values, Address startAddress, Address endAddress, Style style) |
| Adds a list of object values to a defined cell range. If the type of the particular value does not match with one of the supported data types, it will be cast to a String. Prepared objects of the type Cell will not be cast but adjusted. | |
| void | AddCellRange (IReadOnlyList< object > values, string cellRange) |
| Adds a list of object values to a defined cell range. If the type of the particular value does not match with one of the supported data types, it will be cast to a String. Prepared objects of the type Cell will not be cast but adjusted. | |
| void | AddCellRange (IReadOnlyList< object > values, string cellRange, Style style) |
| Adds a list of object values to a defined cell range. If the type of the particular value does not match with one of the supported data types, it will be cast to a String. Prepared objects of the type Cell will not be cast but adjusted. | |
| bool | RemoveCell (int columnNumber, int rowNumber) |
| Removes a previous inserted cell at the defined address. | |
| bool | RemoveCell (string address) |
| Removes a previous inserted cell at the defined address. | |
| void | SetStyle (Range cellRange, Style style) |
| Sets the passed style on the passed cell range. If cells are already existing, the style will be added or replaced. Otherwise, an empty cell will be added with the assigned style. If the passed style is null, all styles will be removed on existing cells and no additional (empty) cells are added to the worksheet. | |
| void | SetStyle (Address startAddress, Address endAddress, Style style) |
| Sets the passed style on the passed cell range, derived from a start and end address. If cells are already existing, the style will be added or replaced. Otherwise, an empty cell will be added with the assigned style. If the passed style is null, all styles will be removed on existing cells and no additional (empty) cells are added to the worksheet. | |
| void | SetStyle (Address address, Style style) |
| Sets the passed style on the passed (singular) cell address. If the cell is already existing, the style will be added or replaced. Otherwise, an empty cell will be added with the assigned style. If the passed style is null, all styles will be removed on existing cells and no additional (empty) cells are added to the worksheet. | |
| void | SetStyle (string addressExpression, Style style) |
| Sets the passed style on the passed address expression. Such an expression may be a single cell or a cell range. If the cell is already existing, the style will be added or replaced. Otherwise, an empty cell will be added with the assigned style. If the passed style is null, all styles will be removed on existing cells and no additional (empty) cells are added to the worksheet. | |
| int | GetFirstColumnNumber () |
| Gets the first existing column number in the current worksheet (zero-based). | |
| int | GetFirstDataColumnNumber () |
| Gets the first existing column number with data in the current worksheet (zero-based). | |
| int | GetFirstRowNumber () |
| Gets the first existing row number in the current worksheet (zero-based). | |
| int | GetFirstDataRowNumber () |
| Gets the first existing row number with data in the current worksheet (zero-based). | |
| int | GetLastColumnNumber () |
| Gets the last existing column number in the current worksheet (zero-based). | |
| int | GetLastDataColumnNumber () |
| Gets the last existing column number with data in the current worksheet (zero-based). | |
| int | GetLastRowNumber () |
| Gets the last existing row number in the current worksheet (zero-based). | |
| int | GetLastDataRowNumber () |
| Gets the last existing row number with data in the current worksheet (zero-based). | |
| Address? | GetLastCellAddress () |
| Gets the last existing cell in the current worksheet (bottom right). | |
| Address? | GetLastDataCellAddress () |
| Gets the last existing cell with data in the current worksheet (bottom right). | |
| Address? | GetFirstCellAddress () |
| Gets the first existing cell in the current worksheet (bottom right). | |
| Address? | GetFirstDataCellAddress () |
| Gets the first existing cell with data in the current worksheet (bottom right). | |
| void | InsertRow (int rowNumber, int numberOfNewRows) |
| Inserts 'count' rows below the specified 'rowNumber'. Existing cells are moved down by the number of new rows. The inserted, new rows inherits the style of the original cell at the defined row number. The inserted cells are empty. The values can be set later. | |
| void | InsertColumn (int columnNumber, int numberOfNewColumns) |
| Inserts 'count' columns right of the specified 'columnNumber'. Existing cells are moved to the right by the number of new columns. The inserted, new columns inherits the style of the original cell at the defined column number. The inserted cells are empty. The values can be set later. | |
| Cell | FirstCellByValue (object searchValue) |
| Searches for the first occurrence of the value. | |
| Cell | FirstOrDefaultCell (Func< Cell, bool > predicate) |
| Searches for the first occurrence of the expression. Example: var cell = worksheet.FindCell(c => c.Value?.ToString().Contains("searchValue"));. | |
| List< Cell > | CellsByValue (object searchValue) |
| Searches for cells that contain the specified value and returns a list of these cells. | |
| int | ReplaceCellValue (object oldValue, object newValue) |
| Replaces all occurrences of 'oldValue' with 'newValue' and returns the number of replacements. | |
| void | AddAllowedActionOnSheetProtection (SheetProtectionValue typeOfProtection) |
| Method to add allowed actions if the worksheet is protected. If one or more values are added, UseSheetProtection will be set to true. | |
| void | AddHiddenColumn (int columnNumber) |
| Sets the defined column as hidden. | |
| void | AddHiddenColumn (string columnAddress) |
| Sets the defined column as hidden. | |
| void | AddHiddenRow (int rowNumber) |
| Sets the defined row as hidden. | |
| void | ClearActiveStyle () |
| Clears the active style of the worksheet. All later added calls will contain no style unless another active style is set. | |
| Cell | GetCell (Address address) |
| Gets the cell of the specified address. | |
| Cell | GetCell (int columnNumber, int rowNumber) |
| Gets the cell of the specified column and row number (zero-based). | |
| bool | HasCell (Address address) |
| Gets whether the specified address exists in the worksheet. Existing means that a value was stored at the address. | |
| bool | HasCell (int columnNumber, int rowNumber) |
| Gets whether the specified address exists in the worksheet. Existing means that a value was stored at the address. | |
| void | ResetColumn (int columnNumber) |
| Resets the defined column, if existing. The corresponding instance will be removed from Columns. | |
| IReadOnlyList< Cell > | GetRow (int rowNumber) |
| Gets a row as list of cell objects. | |
| IReadOnlyList< Cell > | GetColumn (string columnAddress) |
| Gets a column as list of cell objects. | |
| IReadOnlyList< Cell > | GetColumn (int columnNumber) |
| Gets a column as list of cell objects. | |
| int | GetCurrentColumnNumber () |
| Gets the current column number (zero based). | |
| int | GetCurrentRowNumber () |
| Gets the current row number (zero based). | |
| void | GoToNextColumn () |
| Moves the current position to the next column. | |
| void | GoToNextColumn (int numberOfColumns, bool keepRowPosition=false) |
| Moves the current position to the next column with the number of cells to move. | |
| void | GoToNextRow () |
| Moves the current position to the next row (use for a new line). | |
| void | GoToNextRow (int numberOfRows, bool keepColumnPosition=false) |
| Moves the current position to the next row with the number of cells to move (use for a new line). | |
| string | MergeCells (Range cellRange) |
| Merges the defined cell range. | |
| string | MergeCells (string cellRange) |
| Merges the defined cell range. | |
| string | MergeCells (Address startAddress, Address endAddress) |
| Merges the defined cell range. | |
| void | RemoveAutoFilter () |
| Removes auto filters from the worksheet. | |
| void | RemoveHiddenColumn (int columnNumber) |
| Sets a previously defined, hidden column as visible again. | |
| void | RemoveHiddenColumn (string columnAddress) |
| Sets a previously defined, hidden column as visible again. | |
| void | RemoveHiddenRow (int rowNumber) |
| Sets a previously defined, hidden row as visible again. | |
| void | RemoveMergedCells (string range) |
| Removes the defined merged cell range. | |
| void | RemoveRowHeight (int rowNumber) |
| Removes the defined, non-standard row height. | |
| void | RemoveAllowedActionOnSheetProtection (SheetProtectionValue value) |
| Removes an allowed action on the current worksheet or its cells. | |
| void | SetActiveStyle (Style style) |
| Sets the active style of the worksheet. This style will be assigned to all later added cells. | |
| void | SetAutoFilter (int startColumn, int endColumn) |
| Sets the column auto filter within the defined column range. | |
| void | SetAutoFilter (string range) |
| Sets the column auto filter within the defined column range. | |
| void | SetColumnWidth (string columnAddress, float width) |
| Sets the width of the passed column address. | |
| void | SetColumnWidth (int columnNumber, float width) |
| Sets the width of the passed column number (zero-based). | |
| Style | SetColumnDefaultStyle (string columnAddress, Style style) |
| Sets the default column style of the passed column address. | |
| Style | SetColumnDefaultStyle (int columnNumber, Style style) |
| Sets the default column style of the passed column number (zero-based). | |
| void | SetCurrentCellAddress (int columnNumber, int rowNumber) |
| Set the current cell address. | |
| void | SetCurrentCellAddress (string address) |
| Set the current cell address. | |
| void | SetCurrentColumnNumber (int columnNumber) |
| Sets the current column number (zero based). | |
| void | SetCurrentRowNumber (int rowNumber) |
| Sets the current row number (zero based). | |
| void | AddSelectedCells (Range range) |
| Adds a range to the selected cells on this worksheet. | |
| void | AddSelectedCells (Address startAddress, Address endAddress) |
| Adds a range to the selected cells on this worksheet. | |
| void | AddSelectedCells (string rangeOrAddress) |
| Adds a range or cell address to the selected cells on this worksheet. | |
| void | AddSelectedCells (Address address) |
| Adds a single cell address to the selected cells on this worksheet. | |
| void | ClearSelectedCells () |
| Removes all cell selections of this worksheet. | |
| void | RemoveSelectedCells (Range range) |
| Removes the given range from the selected cell ranges of this worksheet, if existing. If the passed range is overlapping the ranges of the selected cells, only the intersecting addresses will be removed. | |
| void | RemoveSelectedCells (String rangeOrAddress) |
| Removes the given range or cell address from the selected cell ranges of this worksheet, if existing. | |
| void | RemoveSelectedCells (Address startAddress, Address endAddress) |
| Removes the given range from the selected cell ranges of this worksheet, if existing. | |
| void | RemoveSelectedCells (Address address) |
| Removes the given address from the selected cell ranges of this worksheet, if existing. | |
| void | SetSheetProtectionPassword (string password) |
| Sets or removes the password for worksheet protection. If set, UseSheetProtection will be also set to true. | |
| void | SetRowHeight (int rowNumber, float height) |
| Sets the height of the passed row number (zero-based). | |
| void | SetSheetName (string name) |
| Validates and sets the worksheet name. | |
| void | SetSheetName (string name, bool sanitize) |
| Sets the name of the worksheet. | |
| void | SetHorizontalSplit (float topPaneHeight, Address topLeftCell, WorksheetPane? activePane) |
| Sets the horizontal split of the worksheet into two panes. The measurement in characters cannot be used to freeze panes. | |
| void | SetHorizontalSplit (int numberOfRowsFromTop, bool freeze, Address topLeftCell, WorksheetPane? activePane) |
| Sets the horizontal split of the worksheet into two panes. The measurement in rows can be used to split and freeze panes. | |
| void | SetVerticalSplit (float leftPaneWidth, Address topLeftCell, WorksheetPane? activePane) |
| Sets the vertical split of the worksheet into two panes. The measurement in characters cannot be used to freeze panes. | |
| void | SetVerticalSplit (int numberOfColumnsFromLeft, bool freeze, Address topLeftCell, WorksheetPane? activePane) |
| Sets the vertical split of the worksheet into two panes. The measurement in columns can be used to split and freeze panes. | |
| void | SetSplit (int? numberOfColumnsFromLeft, int? numberOfRowsFromTop, bool freeze, Address topLeftCell, WorksheetPane? activePane) |
| Sets the horizontal and vertical split of the worksheet into four panes. The measurement in rows and columns can be used to split and freeze panes. | |
| void | SetSplit (float? leftPaneWidth, float? topPaneHeight, Address topLeftCell, WorksheetPane? activePane) |
| Sets the horizontal and vertical split of the worksheet into four panes. The measurement in characters cannot be used to freeze panes. | |
| void | ResetSplit () |
| Resets splitting of the worksheet into panes, as well as their freezing. | |
| Worksheet | Copy () |
| Creates a (dereferenced) deep copy of this worksheet. | |
| void | SetZoomFactor (SheetViewType sheetViewType, int zoomFactor) |
| Sets a zoom factor for a given SheetViewType. If AutoZoomFactor, the zoom factor is set to automatic. | |
Static Public Member Functions | |
| static string | SanitizeWorksheetName (string input, Workbook workbook) |
| Sanitizes a worksheet name. | |
Static Public Attributes | |
| static readonly int | MaxWorksheetNameLength = 31 |
| Maximum number of characters a worksheet name can have. | |
| static readonly float | DefaultWorksheetColumnWidth = 10f |
| Default column width as constant. | |
| static readonly float | DefaultWorksheetRowHeight = 15f |
| Default row height as constant. | |
| static readonly int | MaxColumnNumber = 16383 |
| Maximum column number (zero-based) as constant. | |
| static readonly int | MinColumnNumber = 0 |
| Minimum column number (zero-based) as constant. | |
| static readonly float | MinColumnWidth = 0f |
| Minimum column width as constant. | |
| static readonly float | MinRowHeight = 0f |
| Minimum row height as constant. | |
| static readonly float | MaxColumnWidth = 255f |
| Maximum column width as constant. | |
| static readonly int | MaxRowNumber = 1048575 |
| Maximum row number (zero-based) as constant. | |
| static readonly int | MinRowNumber = 0 |
| Minimum row number (zero-based) as constant. | |
| static readonly float | MaxRowHeight = 409.5f |
| Maximum row height as constant. | |
| const int | AutoZoomFactor = 0 |
| Automatic zoom factor of a worksheet. | |
| const int | MinZoomFactor = 10 |
| Minimum zoom factor of a worksheet. If set to this value, the zoom is set to automatic. | |
| const int | maxZoomFactor = 400 |
| Maximum zoom factor of a worksheet. | |
Properties | |
| Range? | AutoFilterRange [get] |
| Gets the range of the auto-filter. Wrapped to Nullable to provide null as value. If null, no auto-filter is applied. | |
| Dictionary< string, Cell > | Cells [get] |
| Gets the cells of the worksheet as dictionary with the cell address as key and the cell object as value. | |
| Dictionary< int, Column > | Columns [get] |
| 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. | |
| CellDirection | CurrentCellDirection [get, set] |
| Gets or sets the direction when using AddNextCell method. | |
| float | DefaultColumnWidth [get, set] |
| Gets or sets the default column width. | |
| float | DefaultRowHeight [get, set] |
| Gets or sets the default Row height. | |
| Dictionary< int, bool > | HiddenRows [get] |
| Gets the hidden rows as dictionary with the zero-based row number as key and a boolean as value. True indicates hidden, false visible. | |
| Dictionary< int, float > | RowHeights [get] |
| 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. | |
| Dictionary< string, Range > | MergedCells [get] |
| Gets the merged cells (only references) as dictionary with the cell address as key and the range object as value. | |
| List< Range > | SelectedCells [get] |
| Gets the cell ranges of selected cells of this worksheet. Returns ans empty list if no cells are selected. | |
| int | SheetID [get, set] |
| Gets or sets the internal ID of the worksheet. | |
| string | SheetName [get, set] |
| Gets or sets the name of the worksheet. | |
| virtual IPassword | SheetProtectionPassword [get, set] |
| Password instance of the worksheet protection. If a password was set, the pain text representation and the hash can be read from the instance. | |
| List< SheetProtectionValue > | SheetProtectionValues [get] |
| Gets the list of SheetProtectionValues. These values define the allowed actions if the worksheet is protected. | |
| bool | UseSheetProtection [get, set] |
| Gets or sets whether the worksheet is protected. If true, protection is enabled. | |
| Workbook | WorkbookReference [get, set] |
| Gets or sets the Reference to the parent Workbook. | |
| bool | Hidden [get, set] |
| gets or sets whether the worksheet is hidden. If true, the worksheet is not listed in the worksheet tabs of the workbook. If the worksheet is not part of a workbook, or the only one in the workbook, an exception will be thrown. If the worksheet is the selected one, and attempted to set hidden, an exception will be thrown. Define another selected worksheet prior to this call, in this case. | |
| float? | PaneSplitTopHeight [get] |
| Gets the height of the upper, horizontal split pane, measured from the top of the window. The value is nullable. If null, no horizontal split of the worksheet is applied. The value is only applicable to split the worksheet into panes, but not to freeze them. See also: PaneSplitAddress. | |
| float? | PaneSplitLeftWidth [get] |
| Gets the width of the left, vertical split pane, measured from the left of the window. The value is nullable. If null, no vertical split of the worksheet is applied The value is only applicable to split the worksheet into panes, but not to freeze them. See also: PaneSplitAddress. | |
| bool? | FreezeSplitPanes [get] |
| Gets whether split panes are frozen. The value is nullable. If null, no freezing is applied. This property also does not apply if PaneSplitAddress is null. | |
| Address? | PaneSplitTopLeftCell [get] |
| Gets the Top Left cell address of the bottom right pane if applicable and splitting is applied. The column is only relevant for vertical split, whereas the row component is only relevant for a horizontal split. The value is nullable. If null, no splitting was defined. | |
| Address? | PaneSplitAddress [get] |
| Gets the split address for frozen panes or if pane split was defined in number of columns and / or rows. For vertical splits, only the column component is considered. For horizontal splits, only the row component is considered. The value is nullable. If null, no frozen panes or split by columns / rows are applied to the worksheet. However, splitting can still be applied, if the value is defined in characters. See also: PaneSplitLeftWidth and PaneSplitTopHeight for splitting in characters (without freezing). | |
| WorksheetPane? | ActivePane [get] |
| Gets the active Pane is splitting is applied. The value is nullable. If null, no splitting was defined. | |
| Style | ActiveStyle [get] |
| Gets the active Style of the worksheet. If null, no style is defined as active. | |
| bool | ShowGridLines [get, set] |
| Gets or sets whether grid lines are visible on the current worksheet. Default is true. | |
| bool | ShowRowColumnHeaders [get, set] |
| Gets or sets whether the column and row headers are visible on the current worksheet. Default is true. | |
| bool | ShowRuler [get, set] |
| Gets or sets whether a ruler is displayed over the column headers. This value only applies if ViewType is set to SheetViewType.PageLayout. Default is true. | |
| SheetViewType | ViewType [get, set] |
| Gets or sets how the current worksheet is displayed in the spreadsheet application (Excel). | |
| int | ZoomFactor [get, set] |
| Gets or sets the zoom factor of the ViewType of the current worksheet. If AutoZoomFactor, the zoom factor is set to automatic. | |
| Dictionary< SheetViewType, int > | ZoomFactors [get] |
| Gets all defined zoom factors per SheetViewType of the current worksheet. Use SetZoomFactor(SheetViewType, int) to define the values. | |
Class representing a worksheet of a workbook.
Definition at line 25 of file Worksheet.cs.
Enum to define the direction when using AddNextCell method.
Definition at line 105 of file Worksheet.cs.
Enum to define the possible protection types when protecting a worksheet.
Definition at line 118 of file Worksheet.cs.
Enum to define how a worksheet is displayed in the spreadsheet application (Excel).
Definition at line 171 of file Worksheet.cs.
Enum to define the pane position or active pane in a slip worksheet.
Definition at line 156 of file Worksheet.cs.
| NanoXLSX.Worksheet.Worksheet | ( | ) |
Default Constructor.
Definition at line 533 of file Worksheet.cs.
| NanoXLSX.Worksheet.Worksheet | ( | string | name | ) |
Constructor with worksheet name.
Definition at line 564 of file Worksheet.cs.
| NanoXLSX.Worksheet.Worksheet | ( | string | name, |
| int | id, | ||
| Workbook | reference ) |
Constructor with name and sheet ID.
| name | Name of the worksheet |
| id | ID of the worksheet (for internal use) |
| reference | Reference to the parent Workbook |
Definition at line 576 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddAllowedActionOnSheetProtection | ( | SheetProtectionValue | typeOfProtection | ) |
Method to add allowed actions if the worksheet is protected. If one or more values are added, UseSheetProtection will be set to true.
| typeOfProtection | Allowed action on the worksheet or cells |
Definition at line 1583 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCell | ( | object | value, |
| int | columnNumber, | ||
| int | rowNumber ) |
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 cast to a String. A prepared object of the type Cell will not be cast but adjusted.
| value | Unspecified value to insert |
| columnNumber | Column number (zero based) |
| rowNumber | Row number (zero based) |
| RangeException | Throws a RangeException if the passed cell address is out of range |
Definition at line 733 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCell | ( | object | value, |
| int | columnNumber, | ||
| int | rowNumber, | ||
| Style | 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 cast to a String. A prepared object of the type Cell will not be cast but adjusted.
| value | Unspecified value to insert |
| columnNumber | Column number (zero based) |
| rowNumber | Row number (zero based) |
| style | Style to apply on the cell |
| StyleException | Throws a StyleException if the passed style is malformed |
| RangeException | Throws a RangeException if the passed cell address is out of range |
Definition at line 750 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCell | ( | object | value, |
| string | address ) |
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 cast to a String. A prepared object of the type Cell will not be cast but adjusted.
| value | Unspecified value to insert |
| address | Cell address in the format A1 - XFD1048576 |
| RangeException | Throws a RangeException if the passed cell address is out of range |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed cell address is malformed |
Definition at line 766 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCell | ( | object | value, |
| string | address, | ||
| Style | 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 cast to a String. A prepared object of the type Cell will not be cast but adjusted.
| value | Unspecified value to insert |
| address | Cell address in the format A1 - XFD1048576 |
| style | Style to apply on the cell |
| StyleException | Throws a StyleException if the passed style is malformed |
| RangeException | Throws a RangeException if the passed cell address is out of range |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed cell address is malformed |
Definition at line 786 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCellFormula | ( | string | formula, |
| int | columnNumber, | ||
| int | rowNumber ) |
Adds a cell formula as string to the defined cell address.
| formula | Formula to insert |
| columnNumber | Column number (zero based) |
| rowNumber | Row number (zero based) |
| RangeException | Throws a RangeException if the passed cell address is out of range |
Definition at line 839 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCellFormula | ( | string | formula, |
| int | columnNumber, | ||
| int | rowNumber, | ||
| Style | style ) |
Adds a cell formula as string to the defined cell address.
| formula | Formula to insert |
| columnNumber | Column number (zero based) |
| rowNumber | Row number (zero based) |
| style | Style to apply on the cell |
| RangeException | Throws a RangeException if the passed cell address is out of range |
Definition at line 853 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCellFormula | ( | string | formula, |
| string | address ) |
Adds a cell formula as string to the defined cell address.
| formula | Formula to insert |
| address | Cell address in the format A1 - XFD1048576 |
| RangeException | Throws a RangeException if the passed cell address is out of range |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed cell address is malformed |
Definition at line 805 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCellFormula | ( | string | formula, |
| string | address, | ||
| Style | style ) |
Adds a cell formula as string to the defined cell address.
| formula | Formula to insert |
| address | Cell address in the format A1 - XFD1048576 |
| style | Style to apply on the cell |
| StyleException | Throws a StyleException if the passed style was malformed |
| RangeException | Throws a RangeException if the passed cell address is out of range |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed cell address is malformed |
Definition at line 823 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCellRange | ( | IReadOnlyList< object > | values, |
| Address | startAddress, | ||
| Address | endAddress ) |
Adds a list of object values to a defined cell range. If the type of the particular value does not match with one of the supported data types, it will be cast to a String. Prepared objects of the type Cell will not be cast but adjusted.
| values | List of unspecified objects to insert |
| startAddress | Start address |
| endAddress | End address |
| RangeException | Throws a RangeException if the number of cells resolved from the range differs from the number of passed values |
Definition at line 896 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCellRange | ( | IReadOnlyList< object > | values, |
| Address | startAddress, | ||
| Address | endAddress, | ||
| Style | style ) |
Adds a list of object values to a defined cell range. If the type of the particular value does not match with one of the supported data types, it will be cast to a String. Prepared objects of the type Cell will not be cast but adjusted.
| values | List of unspecified objects to insert |
| startAddress | Start address |
| endAddress | End address |
| style | Style to apply on the all cells of the range |
| RangeException | Throws a RangeException if the number of cells resolved from the range differs from the number of passed values |
| StyleException | Throws a StyleException if the passed style is malformed |
Definition at line 913 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCellRange | ( | IReadOnlyList< object > | values, |
| string | cellRange ) |
Adds a list of object values to a defined cell range. If the type of the particular value does not match with one of the supported data types, it will be cast to a String. Prepared objects of the type Cell will not be cast but adjusted.
| values | List of unspecified objects to insert |
| cellRange | Cell range as string in the format like A1:D1 or X10:X22 |
| RangeException | Throws a RangeException if the number of cells resolved from the range differs from the number of passed values |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed cell range is malformed |
Definition at line 928 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddCellRange | ( | IReadOnlyList< object > | values, |
| string | cellRange, | ||
| Style | style ) |
Adds a list of object values to a defined cell range. If the type of the particular value does not match with one of the supported data types, it will be cast to a String. Prepared objects of the type Cell will not be cast but adjusted.
| values | List of unspecified objects to insert |
| cellRange | Cell range as string in the format like A1:D1 or X10:X22 |
| style | Style to apply on the all cells of the range |
| RangeException | Throws a RangeException if the number of cells resolved from the range differs from the number of passed values |
| StyleException | Throws a StyleException if the passed style is malformed |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed cell range is malformed |
Definition at line 946 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddHiddenColumn | ( | int | columnNumber | ) |
Sets the defined column as hidden.
| columnNumber | Column number to hide on the worksheet |
| RangeException | Throws a RangeException if the passed column number is out of range |
Definition at line 1601 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddHiddenColumn | ( | string | columnAddress | ) |
Sets the defined column as hidden.
| columnAddress | Column address to hide on the worksheet |
| RangeException | Throws a RangeException if the passed column address is out of range |
Definition at line 1611 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddHiddenRow | ( | int | rowNumber | ) |
Sets the defined row as hidden.
| rowNumber | Row number to hide on the worksheet |
| RangeException | Throws a RangeException if the passed row number is out of range |
Definition at line 1622 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddNextCell | ( | object | value | ) |
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 cast to a String. A prepared object of the type Cell will not be cast but adjusted.
| value | Unspecified value to insert |
| RangeException | Throws a RangeException if the next cell is out of range (on row or column) |
Definition at line 596 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddNextCell | ( | object | value, |
| Style | 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 cast to a String. A prepared object of the type Cell will not be cast but adjusted.
| value | Unspecified value to insert |
| style | Style object to apply on this cell |
| RangeException | Throws a RangeException if the next cell is out of range (on row or column) |
| StyleException | Throws a StyleException if the default style was malformed |
Definition at line 612 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddNextCellFormula | ( | string | formula | ) |
Adds a formula as string to the next cell position.
| formula | Formula to insert |
| RangeException | Trows a RangeException if the next cell is out of range (on row or column) |
Definition at line 864 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddNextCellFormula | ( | string | formula, |
| Style | style ) |
Adds a formula as string to the next cell position.
| formula | Formula to insert |
| style | Style to apply on the cell |
| RangeException | Trows a RangeException if the next cell is out of range (on row or column) |
Definition at line 876 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddSelectedCells | ( | Address | address | ) |
Adds a single cell address to the selected cells on this worksheet.
| address | Cell address to add |
Definition at line 2305 of file Worksheet.cs.
Adds a range to the selected cells on this worksheet.
| startAddress | Start address of the range |
| endAddress | End address of the range |
Definition at line 2283 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddSelectedCells | ( | Range | range | ) |
Adds a range to the selected cells on this worksheet.
| range | Cell range to add |
Definition at line 2273 of file Worksheet.cs.
| void NanoXLSX.Worksheet.AddSelectedCells | ( | string | rangeOrAddress | ) |
Adds a range or cell address to the selected cells on this worksheet.
| rangeOrAddress | Cell range or address to add |
Definition at line 2292 of file Worksheet.cs.
| List< Cell > NanoXLSX.Worksheet.CellsByValue | ( | object | searchValue | ) |
Searches for cells that contain the specified value and returns a list of these cells.
| searchValue | The value to search for. |
Definition at line 1549 of file Worksheet.cs.
| void NanoXLSX.Worksheet.ClearActiveStyle | ( | ) |
Clears the active style of the worksheet. All later added calls will contain no style unless another active style is set.
Definition at line 1630 of file Worksheet.cs.
| void NanoXLSX.Worksheet.ClearSelectedCells | ( | ) |
Removes all cell selections of this worksheet.
Definition at line 2313 of file Worksheet.cs.
| Worksheet NanoXLSX.Worksheet.Copy | ( | ) |
Creates a (dereferenced) deep copy of this worksheet.
Definition at line 2596 of file Worksheet.cs.
| Cell NanoXLSX.Worksheet.FirstCellByValue | ( | object | searchValue | ) |
Searches for the first occurrence of the value.
| searchValue | The value to search for. |
Definition at line 1524 of file Worksheet.cs.
Searches for the first occurrence of the expression. Example: var cell = worksheet.FindCell(c => c.Value?.ToString().Contains("searchValue"));.
| predicate |
Definition at line 1538 of file Worksheet.cs.
Gets the cell of the specified address.
| address | Address of the cell |
| WorksheetException | Trows a WorksheetException if the cell was not found on the cell table of this worksheet |
Definition at line 1642 of file Worksheet.cs.
| Cell NanoXLSX.Worksheet.GetCell | ( | int | columnNumber, |
| int | rowNumber ) |
Gets the cell of the specified column and row number (zero-based).
| columnNumber | Column number of the cell |
| rowNumber | Row number of the cell |
| WorksheetException | Trows a WorksheetException if the cell was not found on the cell table of this worksheet |
Definition at line 1658 of file Worksheet.cs.
| IReadOnlyList< Cell > NanoXLSX.Worksheet.GetColumn | ( | int | columnNumber | ) |
Gets a column as list of cell objects.
| columnNumber | Column number (zero-based) |
Definition at line 1743 of file Worksheet.cs.
| IReadOnlyList< Cell > NanoXLSX.Worksheet.GetColumn | ( | string | columnAddress | ) |
Gets a column as list of cell objects.
| columnAddress | Column address |
| RangeException | A range exception is thrown if the address is not valid |
Definition at line 1732 of file Worksheet.cs.
| int NanoXLSX.Worksheet.GetCurrentColumnNumber | ( | ) |
Gets the current column number (zero based).
Definition at line 1761 of file Worksheet.cs.
| int NanoXLSX.Worksheet.GetCurrentRowNumber | ( | ) |
Gets the current row number (zero based).
Definition at line 1770 of file Worksheet.cs.
| Address? NanoXLSX.Worksheet.GetFirstCellAddress | ( | ) |
Gets the first existing cell in the current worksheet (bottom right).
Definition at line 1236 of file Worksheet.cs.
| int NanoXLSX.Worksheet.GetFirstColumnNumber | ( | ) |
Gets the first existing column number in the current worksheet (zero-based).
Definition at line 1108 of file Worksheet.cs.
| Address? NanoXLSX.Worksheet.GetFirstDataCellAddress | ( | ) |
Gets the first existing cell with data in the current worksheet (bottom right).
Definition at line 1253 of file Worksheet.cs.
| int NanoXLSX.Worksheet.GetFirstDataColumnNumber | ( | ) |
Gets the first existing column number with data in the current worksheet (zero-based).
Definition at line 1119 of file Worksheet.cs.
| int NanoXLSX.Worksheet.GetFirstDataRowNumber | ( | ) |
Gets the first existing row number with data in the current worksheet (zero-based).
Definition at line 1141 of file Worksheet.cs.
| int NanoXLSX.Worksheet.GetFirstRowNumber | ( | ) |
Gets the first existing row number in the current worksheet (zero-based).
Definition at line 1130 of file Worksheet.cs.
| Address? NanoXLSX.Worksheet.GetLastCellAddress | ( | ) |
Gets the last existing cell in the current worksheet (bottom right).
Definition at line 1201 of file Worksheet.cs.
| int NanoXLSX.Worksheet.GetLastColumnNumber | ( | ) |
Gets the last existing column number in the current worksheet (zero-based).
Definition at line 1153 of file Worksheet.cs.
| Address? NanoXLSX.Worksheet.GetLastDataCellAddress | ( | ) |
Gets the last existing cell with data in the current worksheet (bottom right).
Definition at line 1219 of file Worksheet.cs.
| int NanoXLSX.Worksheet.GetLastDataColumnNumber | ( | ) |
Gets the last existing column number with data in the current worksheet (zero-based).
Definition at line 1164 of file Worksheet.cs.
| int NanoXLSX.Worksheet.GetLastDataRowNumber | ( | ) |
Gets the last existing row number with data in the current worksheet (zero-based).
Definition at line 1188 of file Worksheet.cs.
| int NanoXLSX.Worksheet.GetLastRowNumber | ( | ) |
Gets the last existing row number in the current worksheet (zero-based).
Definition at line 1176 of file Worksheet.cs.
| IReadOnlyList< Cell > NanoXLSX.Worksheet.GetRow | ( | int | rowNumber | ) |
Gets a row as list of cell objects.
| rowNumber | Row number (zero-based) |
Definition at line 1712 of file Worksheet.cs.
| void NanoXLSX.Worksheet.GoToNextColumn | ( | ) |
Moves the current position to the next column.
Definition at line 1778 of file Worksheet.cs.
| void NanoXLSX.Worksheet.GoToNextColumn | ( | int | numberOfColumns, |
| bool | keepRowPosition = false ) |
Moves the current position to the next column with the number of cells to move.
| numberOfColumns | Number of columns to move |
| keepRowPosition | If true, the row position is preserved, otherwise set to 0 |
Definition at line 1791 of file Worksheet.cs.
| void NanoXLSX.Worksheet.GoToNextRow | ( | ) |
Moves the current position to the next row (use for a new line).
Definition at line 1804 of file Worksheet.cs.
| void NanoXLSX.Worksheet.GoToNextRow | ( | int | numberOfRows, |
| bool | keepColumnPosition = false ) |
Moves the current position to the next row with the number of cells to move (use for a new line).
| numberOfRows | Number of rows to move |
| keepColumnPosition | If true, the column position is preserved, otherwise set to 0 |
Definition at line 1817 of file Worksheet.cs.
| bool NanoXLSX.Worksheet.HasCell | ( | Address | address | ) |
Gets whether the specified address exists in the worksheet. Existing means that a value was stored at the address.
| address | Address to check |
true if the cell exists, otherwise false. Definition at line 1670 of file Worksheet.cs.
| bool NanoXLSX.Worksheet.HasCell | ( | int | columnNumber, |
| int | rowNumber ) |
Gets whether the specified address exists in the worksheet. Existing means that a value was stored at the address.
| columnNumber | Column number of the cell to check (zero-based) |
| rowNumber | Row number of the cell to check (zero-based) |
true if the cell exists, otherwise false. | RangeException | A RangeException is thrown if the column or row number is invalid |
Definition at line 1684 of file Worksheet.cs.
| void NanoXLSX.Worksheet.InsertColumn | ( | int | columnNumber, |
| int | numberOfNewColumns ) |
Inserts 'count' columns right of the specified 'columnNumber'. Existing cells are moved to the right by the number of new columns. The inserted, new columns inherits the style of the original cell at the defined column number. The inserted cells are empty. The values can be set later.
Formulas are not adjusted
| columnNumber | Column number right which the new column(s) will be inserted. |
| numberOfNewColumns | Number of columns to insert. |
Definition at line 1476 of file Worksheet.cs.
| void NanoXLSX.Worksheet.InsertRow | ( | int | rowNumber, |
| int | numberOfNewRows ) |
Inserts 'count' rows below the specified 'rowNumber'. Existing cells are moved down by the number of new rows. The inserted, new rows inherits the style of the original cell at the defined row number. The inserted cells are empty. The values can be set later.
Formulas / references are not adjusted
| rowNumber | Row number below which the new row(s) will be inserted. |
| numberOfNewRows | Number of rows to insert. |
Definition at line 1421 of file Worksheet.cs.
Merges the defined cell range.
| startAddress | Start address of the merged cell range |
| endAddress | End address of the merged cell range |
| RangeException | Throws a RangeException if one of the passed cell addresses is out of range or if one or more cell addresses are already occupied in another merge range |
Definition at line 1858 of file Worksheet.cs.
| string NanoXLSX.Worksheet.MergeCells | ( | Range | cellRange | ) |
Merges the defined cell range.
| cellRange | Range to merge |
| RangeException | Throws a RangeException if the passed cell range is out of range |
Definition at line 1833 of file Worksheet.cs.
| string NanoXLSX.Worksheet.MergeCells | ( | string | cellRange | ) |
Merges the defined cell range.
| cellRange | Range to merge (e.g. 'A1:B12') |
| RangeException | Throws a RangeException if the passed cell range is out of range |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed cell range is malformed |
Definition at line 1845 of file Worksheet.cs.
| void NanoXLSX.Worksheet.RemoveAllowedActionOnSheetProtection | ( | SheetProtectionValue | value | ) |
Removes an allowed action on the current worksheet or its cells.
| value | Allowed action on the worksheet or cells |
Definition at line 2062 of file Worksheet.cs.
| void NanoXLSX.Worksheet.RemoveAutoFilter | ( | ) |
Removes auto filters from the worksheet.
Definition at line 1981 of file Worksheet.cs.
| bool NanoXLSX.Worksheet.RemoveCell | ( | int | columnNumber, |
| int | rowNumber ) |
Removes a previous inserted cell at the defined address.
| columnNumber | Column number (zero based) |
| rowNumber | Row number (zero based) |
| RangeException | Throws a RangeException if the passed cell address is out of range |
Definition at line 989 of file Worksheet.cs.
| bool NanoXLSX.Worksheet.RemoveCell | ( | string | address | ) |
Removes a previous inserted cell at the defined address.
| address | Cell address in the format A1 - XFD1048576 |
| RangeException | Throws a RangeException if the passed cell address is out of range |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed cell address is malformed |
Definition at line 1002 of file Worksheet.cs.
| void NanoXLSX.Worksheet.RemoveHiddenColumn | ( | int | columnNumber | ) |
Sets a previously defined, hidden column as visible again.
| columnNumber | Column number to make visible again |
| RangeException | Throws a RangeException if the passed column number is out of range |
Definition at line 1991 of file Worksheet.cs.
| void NanoXLSX.Worksheet.RemoveHiddenColumn | ( | string | columnAddress | ) |
Sets a previously defined, hidden column as visible again.
| columnAddress | Column address to make visible again |
| RangeException | Throws a RangeException if the column address out of range |
Definition at line 2001 of file Worksheet.cs.
| void NanoXLSX.Worksheet.RemoveHiddenRow | ( | int | rowNumber | ) |
Sets a previously defined, hidden row as visible again.
| rowNumber | Row number to hide on the worksheet |
| RangeException | Throws a RangeException if the passed row number is out of range |
Definition at line 2012 of file Worksheet.cs.
| void NanoXLSX.Worksheet.RemoveMergedCells | ( | string | range | ) |
Removes the defined merged cell range.
| range | Cell range to remove the merging |
| RangeException | Throws a RangeException if the passed cell range was not merged earlier |
Definition at line 2022 of file Worksheet.cs.
| void NanoXLSX.Worksheet.RemoveRowHeight | ( | int | rowNumber | ) |
Removes the defined, non-standard row height.
| rowNumber | Row number (zero-based) |
Definition at line 2050 of file Worksheet.cs.
| void NanoXLSX.Worksheet.RemoveSelectedCells | ( | Address | address | ) |
Removes the given address from the selected cell ranges of this worksheet, if existing.
| address | Address of the range to remove |
Definition at line 2355 of file Worksheet.cs.
Removes the given range from the selected cell ranges of this worksheet, if existing.
| startAddress | Start address of the range to remove |
| endAddress | End address of the range to remove |
Definition at line 2346 of file Worksheet.cs.
| void NanoXLSX.Worksheet.RemoveSelectedCells | ( | Range | range | ) |
Removes the given range from the selected cell ranges of this worksheet, if existing. If the passed range is overlapping the ranges of the selected cells, only the intersecting addresses will be removed.
| range | Range to remove |
Definition at line 2323 of file Worksheet.cs.
| void NanoXLSX.Worksheet.RemoveSelectedCells | ( | String | rangeOrAddress | ) |
Removes the given range or cell address from the selected cell ranges of this worksheet, if existing.
| rangeOrAddress | Range or cell address to remove |
Definition at line 2332 of file Worksheet.cs.
| int NanoXLSX.Worksheet.ReplaceCellValue | ( | object | oldValue, |
| object | newValue ) |
Replaces all occurrences of 'oldValue' with 'newValue' and returns the number of replacements.
| oldValue | Old value |
| newValue | New value that should replace the old one |
Definition at line 1563 of file Worksheet.cs.
| void NanoXLSX.Worksheet.ResetColumn | ( | int | columnNumber | ) |
Resets the defined column, if existing. The corresponding instance will be removed from Columns.
| columnNumber | Column number to reset (zero-based) |
Definition at line 1694 of file Worksheet.cs.
| void NanoXLSX.Worksheet.ResetSplit | ( | ) |
Resets splitting of the worksheet into panes, as well as their freezing.
Definition at line 2577 of file Worksheet.cs.
|
static |
Sanitizes a worksheet name.
| input | Name to sanitize |
| workbook | Workbook reference |
| WorksheetException | A WorksheetException is thrown if the workbook reference is null, since all worksheets have to be considered during sanitation |
Definition at line 2698 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetActiveStyle | ( | Style | style | ) |
Sets the active style of the worksheet. This style will be assigned to all later added cells.
| style | Style to set as active style |
Definition at line 2074 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetAutoFilter | ( | int | startColumn, |
| int | endColumn ) |
Sets the column auto filter within the defined column range.
| startColumn | Column number with the first appearance of an auto filter drop down |
| endColumn | Column number with the last appearance of an auto filter drop down |
| RangeException | Throws a RangeException if the start or end address out of range |
Definition at line 2093 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetAutoFilter | ( | string | range | ) |
Sets the column auto filter within the defined column range.
| range | Range to apply auto filter on. The range could be 'A1:C10' for instance. The end row will be recalculated automatically when saving the file |
| RangeException | Throws a RangeException if the passed range out of range |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed range is malformed |
Definition at line 2113 of file Worksheet.cs.
Sets the default column style of the passed column number (zero-based).
| columnNumber | Column number (zero-based, from 0 to 16383) |
| style | Style to set as default. If null, the style is cleared |
| RangeException | Throws a RangeException: a) If the passed column number is out of range b) if the column width is out of range (0 - 255.0) |
Definition at line 2205 of file Worksheet.cs.
Sets the default column style of the passed column address.
| columnAddress | Column address (A - XFD) |
| style | Style to set as default. If null, the style is cleared |
| RangeException | Throws a RangeException: a) If the passed column address is out of range b) if the column width is out of range (0 - 255.0) |
Definition at line 2193 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetColumnWidth | ( | int | columnNumber, |
| float | width ) |
Sets the width of the passed column number (zero-based).
| columnNumber | Column number (zero-based, from 0 to 16383) |
| width | Width from 0 to 255.0 |
| RangeException | Throws a RangeException: a) If the passed column number is out of range b) if the column width is out of range (0 - 255.0) |
Definition at line 2165 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetColumnWidth | ( | string | columnAddress, |
| float | width ) |
Sets the width of the passed column address.
| columnAddress | Column address (A - XFD) |
| width | Width from 0 to 255.0 |
| RangeException | Throws a RangeException: a) If the passed column address is out of range b) if the column width is out of range (0 - 255.0) |
Definition at line 2153 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetCurrentCellAddress | ( | int | columnNumber, |
| int | rowNumber ) |
Set the current cell address.
| columnNumber | Column number (zero based) |
| rowNumber | Row number (zero based) |
| RangeException | Throws a RangeException if one of the passed cell addresses is out of range |
Definition at line 2227 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetCurrentCellAddress | ( | string | address | ) |
Set the current cell address.
| address | Cell address in the format A1 - XFD1048576 |
| RangeException | Throws a RangeException if the passed cell address is out of range |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the passed cell address is malformed |
Definition at line 2239 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetCurrentColumnNumber | ( | int | columnNumber | ) |
Sets the current column number (zero based).
| columnNumber | Column number (zero based) |
| RangeException | Throws a RangeException if the number is out of the valid range. Range is from 0 to 16383 (16384 columns) |
Definition at line 2252 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetCurrentRowNumber | ( | int | rowNumber | ) |
Sets the current row number (zero based).
| rowNumber | Row number (zero based) |
| RangeException | Throws a RangeException if the number is out of the valid range. Range is from 0 to 1048575 (1048576 rows) |
Definition at line 2263 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetHorizontalSplit | ( | float | topPaneHeight, |
| Address | topLeftCell, | ||
| WorksheetPane? | activePane ) |
Sets the horizontal split of the worksheet into two panes. The measurement in characters cannot be used to freeze panes.
| topPaneHeight | Height (similar to row height) from top of the worksheet to the split line in characters |
| topLeftCell | Top Left cell address of the bottom right pane (if applicable). Only the row component is important in a horizontal split |
| activePane | Active pane in the split window. The parameter is nullable |
Definition at line 2476 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetHorizontalSplit | ( | int | numberOfRowsFromTop, |
| bool | freeze, | ||
| Address | topLeftCell, | ||
| WorksheetPane? | activePane ) |
Sets the horizontal split of the worksheet into two panes. The measurement in rows can be used to split and freeze panes.
| numberOfRowsFromTop | Number of rows from top of the worksheet to the split line. The particular row heights are considered |
| freeze | If true, all panes are frozen, otherwise remains movable |
| topLeftCell | Top Left cell address of the bottom right pane (if applicable). Only the row component is important in a horizontal split |
| activePane | Active pane in the split window. The parameter is nullable |
| WorksheetException | WorksheetException Thrown if the row number of the top left cell is smaller the split panes number of rows from top, if freeze is applied |
Definition at line 2489 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetRowHeight | ( | int | rowNumber, |
| float | height ) |
Sets the height of the passed row number (zero-based).
| rowNumber | Row number (zero-based, 0 to 1048575) |
| height | Height from 0 to 409.5 |
| RangeException | Throws a RangeException: a) If the passed row number is out of range b) if the row height is out of range (0 - 409.5) |
Definition at line 2384 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetSheetName | ( | string | name | ) |
Validates and sets the worksheet name.
| name | Name to set |
| NanoXLSX.Exceptions.FormatException | Throws a FormatException if the worksheet name is too long (max. 31) or contains illegal characters [ ] * ? / </exception> |
Definition at line 2432 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetSheetName | ( | string | name, |
| bool | sanitize ) |
Sets the name of the worksheet.
| name | Name of the worksheet |
| sanitize | If true, the filename will be sanitized automatically according to the specifications of Excel |
| WorksheetException | WorksheetException Thrown if no workbook is referenced. This information is necessary to determine whether the name already exists |
Definition at line 2457 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetSheetProtectionPassword | ( | string | password | ) |
Sets or removes the password for worksheet protection. If set, UseSheetProtection will be also set to true.
| password | Password (UTF-8) to protect the worksheet. If the password is null or empty, no password will be used |
Definition at line 2364 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetSplit | ( | float? | leftPaneWidth, |
| float? | topPaneHeight, | ||
| Address | topLeftCell, | ||
| WorksheetPane? | activePane ) |
Sets the horizontal and vertical split of the worksheet into four panes. The measurement in characters cannot be used to freeze panes.
| leftPaneWidth | Width (similar to column width) from left of the worksheet to the split line in characters. The parameter is nullable. If left null, the method acts identical to SetHorizontalSplit(float, Address, WorksheetPane?) |
| topPaneHeight | Height (similar to row height) from top of the worksheet to the split line in characters. The parameter is nullable. If left null, the method acts identical to SetVerticalSplit(float, Address, WorksheetPane?) |
| topLeftCell | Top Left cell address of the bottom right pane (if applicable) |
| activePane | Active pane in the split window. The parameter is nullable |
Definition at line 2564 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetSplit | ( | int? | numberOfColumnsFromLeft, |
| int? | numberOfRowsFromTop, | ||
| bool | freeze, | ||
| Address | topLeftCell, | ||
| WorksheetPane? | activePane ) |
Sets the horizontal and vertical split of the worksheet into four panes. The measurement in rows and columns can be used to split and freeze panes.
| numberOfColumnsFromLeft | Number of columns from left of the worksheet to the split line. The particular column widths are considered. The parameter is nullable. If left null, the method acts identical to SetHorizontalSplit(int, bool, Address, WorksheetPane?) |
| numberOfRowsFromTop | Number of rows from top of the worksheet to the split line. The particular row heights are considered. The parameter is nullable. If left null, the method acts identical to SetVerticalSplit(int, bool, Address, WorksheetPane?) |
| freeze | If true, all panes are frozen, otherwise remains movable |
| topLeftCell | Top Left cell address of the bottom right pane (if applicable) |
| activePane | Active pane in the split window. The parameter is nullable |
| WorksheetException | WorksheetException Thrown if the address of the top left cell is smaller the split panes address, if freeze is applied |
Definition at line 2530 of file Worksheet.cs.
Sets the passed style on the passed (singular) cell address. If the cell is already existing, the style will be added or replaced. Otherwise, an empty cell will be added with the assigned style. If the passed style is null, all styles will be removed on existing cells and no additional (empty) cells are added to the worksheet.
Definition at line 1067 of file Worksheet.cs.
Sets the passed style on the passed cell range, derived from a start and end address. If cells are already existing, the style will be added or replaced. Otherwise, an empty cell will be added with the assigned style. If the passed style is null, all styles will be removed on existing cells and no additional (empty) cells are added to the worksheet.
| startAddress | Start address of the cell range |
| endAddress | End address of the cell range |
| style | Style to apply or null to clear the range |
Definition at line 1055 of file Worksheet.cs.
Sets the passed style on the passed cell range. If cells are already existing, the style will be added or replaced. Otherwise, an empty cell will be added with the assigned style. If the passed style is null, all styles will be removed on existing cells and no additional (empty) cells are added to the worksheet.
Definition at line 1020 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetStyle | ( | string | addressExpression, |
| Style | style ) |
Sets the passed style on the passed address expression. Such an expression may be a single cell or a cell range. If the cell is already existing, the style will be added or replaced. Otherwise, an empty cell will be added with the assigned style. If the passed style is null, all styles will be removed on existing cells and no additional (empty) cells are added to the worksheet.
| addressExpression | Expression of a cell address or range of addresses |
| style | Style to apply or null to clear the range |
Definition at line 1080 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetVerticalSplit | ( | float | leftPaneWidth, |
| Address | topLeftCell, | ||
| WorksheetPane? | activePane ) |
Sets the vertical split of the worksheet into two panes. The measurement in characters cannot be used to freeze panes.
| leftPaneWidth | Width (similar to column width) from left of the worksheet to the split line in characters |
| topLeftCell | Top Left cell address of the bottom right pane (if applicable). Only the column component is important in a vertical split |
| activePane | Active pane in the split window. The parameter is nullable |
Definition at line 2500 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetVerticalSplit | ( | int | numberOfColumnsFromLeft, |
| bool | freeze, | ||
| Address | topLeftCell, | ||
| WorksheetPane? | activePane ) |
Sets the vertical split of the worksheet into two panes. The measurement in columns can be used to split and freeze panes.
| numberOfColumnsFromLeft | Number of columns from left of the worksheet to the split line. The particular column widths are considered |
| freeze | If true, all panes are frozen, otherwise remains movable |
| topLeftCell | Top Left cell address of the bottom right pane (if applicable). Only the column component is important in a vertical split |
| activePane | Active pane in the split window. The parameter is nullable |
| WorksheetException | WorksheetException Thrown if the column number of the top left cell is smaller the split panes number of columns from left, if freeze is applied |
Definition at line 2514 of file Worksheet.cs.
| void NanoXLSX.Worksheet.SetZoomFactor | ( | SheetViewType | sheetViewType, |
| int | zoomFactor ) |
Sets a zoom factor for a given SheetViewType. If AutoZoomFactor, the zoom factor is set to automatic.
| sheetViewType | Sheet view type to apply the zoom factor on |
| zoomFactor | Zoom factor in percent |
| WorksheetException | Throws a WorksheetException if the zoom factor is not AutoZoomFactor or below MinZoomFactor or above maxZoomFactor |
Definition at line 2672 of file Worksheet.cs.
|
static |
Automatic zoom factor of a worksheet.
Definition at line 89 of file Worksheet.cs.
|
static |
Default column width as constant.
Definition at line 40 of file Worksheet.cs.
|
static |
Default row height as constant.
Definition at line 44 of file Worksheet.cs.
|
static |
Maximum column number (zero-based) as constant.
Definition at line 48 of file Worksheet.cs.
|
static |
Maximum column width as constant.
Definition at line 70 of file Worksheet.cs.
|
static |
Maximum row height as constant.
Definition at line 84 of file Worksheet.cs.
|
static |
Maximum row number (zero-based) as constant.
Definition at line 74 of file Worksheet.cs.
|
static |
Maximum number of characters a worksheet name can have.
Definition at line 36 of file Worksheet.cs.
|
static |
Maximum zoom factor of a worksheet.
Definition at line 98 of file Worksheet.cs.
|
static |
Minimum column number (zero-based) as constant.
Definition at line 53 of file Worksheet.cs.
|
static |
Minimum column width as constant.
Definition at line 59 of file Worksheet.cs.
|
static |
Minimum row height as constant.
Definition at line 65 of file Worksheet.cs.
|
static |
Minimum row number (zero-based) as constant.
Definition at line 79 of file Worksheet.cs.
|
static |
Minimum zoom factor of a worksheet. If set to this value, the zoom is set to automatic.
Definition at line 94 of file Worksheet.cs.
|
get |
Gets the active Pane is splitting is applied.
The value is nullable. If null, no splitting was defined.
Definition at line 453 of file Worksheet.cs.
|
get |
Gets the active Style of the worksheet. If null, no style is defined as active.
Definition at line 461 of file Worksheet.cs.
|
get |
Gets the range of the auto-filter. Wrapped to Nullable to provide null as value. If null, no auto-filter is applied.
Definition at line 216 of file Worksheet.cs.
|
get |
Gets the cells of the worksheet as dictionary with the cell address as key and the cell object as value.
Definition at line 224 of file Worksheet.cs.
|
get |
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.
Definition at line 232 of file Worksheet.cs.
|
getset |
Gets or sets the direction when using AddNextCell method.
Definition at line 240 of file Worksheet.cs.
|
getset |
Gets or sets the default column width.
| RangeException | Throws a RangeException exception if the passed width is out of range (set) |
Definition at line 246 of file Worksheet.cs.
|
getset |
Gets or sets the default Row height.
| RangeException | Throws a RangeException exception if the passed height is out of range (set) |
Definition at line 263 of file Worksheet.cs.
|
get |
Gets whether split panes are frozen.
The value is nullable. If null, no freezing is applied. This property also does not apply if PaneSplitAddress is null.
Definition at line 421 of file Worksheet.cs.
|
getset |
gets or sets whether the worksheet is hidden. If true, the worksheet is not listed in the worksheet tabs of the workbook.
If the worksheet is not part of a workbook, or the only one in the workbook, an exception will be thrown.
If the worksheet is the selected one, and attempted to set hidden, an exception will be thrown. Define another selected worksheet prior to this call, in this case.
Definition at line 378 of file Worksheet.cs.
|
get |
Gets the hidden rows as dictionary with the zero-based row number as key and a boolean as value. True indicates hidden, false visible.
Definition at line 280 of file Worksheet.cs.
|
get |
Gets the merged cells (only references) as dictionary with the cell address as key and the range object as value.
Definition at line 296 of file Worksheet.cs.
|
get |
Gets the split address for frozen panes or if pane split was defined in number of columns and / or rows.
For vertical splits, only the column component is considered. For horizontal splits, only the row component is considered.
The value is nullable. If null, no frozen panes or split by columns / rows are applied to the worksheet. However, splitting can still be applied, if the value is defined in characters.
See also: PaneSplitLeftWidth and PaneSplitTopHeight for splitting in characters (without freezing).
Definition at line 443 of file Worksheet.cs.
|
get |
Gets the width of the left, vertical split pane, measured from the left of the window.
The value is nullable. If null, no vertical split of the worksheet is applied
The value is only applicable to split the worksheet into panes, but not to freeze them.
See also: PaneSplitAddress.
Definition at line 412 of file Worksheet.cs.
|
get |
Gets the height of the upper, horizontal split pane, measured from the top of the window.
The value is nullable. If null, no horizontal split of the worksheet is applied.
The value is only applicable to split the worksheet into panes, but not to freeze them.
See also: PaneSplitAddress.
Definition at line 399 of file Worksheet.cs.
|
get |
Gets the Top Left cell address of the bottom right pane if applicable and splitting is applied.
The column is only relevant for vertical split, whereas the row component is only relevant for a horizontal split.
The value is nullable. If null, no splitting was defined.
Definition at line 431 of file Worksheet.cs.
|
get |
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.
Definition at line 288 of file Worksheet.cs.
|
get |
Gets the cell ranges of selected cells of this worksheet. Returns ans empty list if no cells are selected.
Definition at line 304 of file Worksheet.cs.
|
getset |
Gets or sets the internal ID of the worksheet.
Definition at line 312 of file Worksheet.cs.
|
getset |
Gets or sets the name of the worksheet.
Definition at line 328 of file Worksheet.cs.
|
getset |
Password instance of the worksheet protection. If a password was set, the pain text representation and the hash can be read from the instance.
Definition at line 338 of file Worksheet.cs.
|
get |
Gets the list of SheetProtectionValues. These values define the allowed actions if the worksheet is protected.
Definition at line 347 of file Worksheet.cs.
|
getset |
Gets or sets whether grid lines are visible on the current worksheet. Default is true.
Definition at line 469 of file Worksheet.cs.
|
getset |
Gets or sets whether the column and row headers are visible on the current worksheet. Default is true.
Definition at line 474 of file Worksheet.cs.
|
getset |
Gets or sets whether a ruler is displayed over the column headers. This value only applies if ViewType is set to SheetViewType.PageLayout. Default is true.
Definition at line 479 of file Worksheet.cs.
|
getset |
Gets or sets whether the worksheet is protected. If true, protection is enabled.
Definition at line 355 of file Worksheet.cs.
|
getset |
Gets or sets how the current worksheet is displayed in the spreadsheet application (Excel).
Definition at line 484 of file Worksheet.cs.
|
getset |
Gets or sets the Reference to the parent Workbook.
Definition at line 360 of file Worksheet.cs.
|
getset |
Gets or sets the zoom factor of the ViewType of the current worksheet. If AutoZoomFactor, the zoom factor is set to automatic.
| WorksheetException | Throws a WorksheetException if the zoom factor is not AutoZoomFactor or below MinZoomFactor or above maxZoomFactor |
Definition at line 502 of file Worksheet.cs.
|
get |
Gets all defined zoom factors per SheetViewType of the current worksheet. Use SetZoomFactor(SheetViewType, int) to define the values.
Definition at line 517 of file Worksheet.cs.