ig.excel.WorksheetRow
Dependencies
-
applyCellFormula
- .applyCellFormula( columnIndex:number, formula:string, [cellReferenceMode:ig.excel.CellReferenceMode] );
Applies a formula to the cell at the specified column index.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
- formula
- Type:string
- The formula to parse and apply to the cell.
- cellReferenceMode
- Type:ig.excel.CellReferenceMode
- Optional
- The mode used to interpret cell references in the formula.
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.ArgumentNullException formula is null or empty. ig.excel.FormulaParseException formula is not a valid formula. ig.InvalidOperationException The cell is part of an array formula or data table which is not confined to just the cell. ig.InvalidOperationException If the row was removed from the worksheet. ig.excel.InvalidEnumArgumentException cellReferenceMode is not defined in the CellReferenceMode enumeration. Remarks
formula is parsed based on the CellReferenceMode of the Workbook to which the row belongs. If the row's Worksheet has been removed from its parent collection, the A1 CellReferenceMode will be used to parse the formula.
-
cells
- .cells( );
- Return Type:
- ig.excel.WorksheetCellCollection
- Return Type Description:
- The collection of cells in the row.
Gets the collection of cells in the row.
Remarks
The collection of cells is a fixed length collection, with the maximum number of cells in the collection being Workbook.maxExcelColumnCount or Workbook.maxExcel2007ColumnCount, depending on the Workbook.CurrentFormat. Internally, the cells are only created and added to the collection when they are requested.
Note: Iterating the collection will not create all cells. It will only iterate the cells which have already been used. To create and iterate all cells in the worksheet use a For loop, iterating from 0 to one less than MaxExcelColumnCount, and pass in each index to the collection's indexer.
-
cells
- .cells( index:number );
- Return Type:
- ig.excel.WorksheetCell
- Return Type Description:
- The cell at the specified column index in the owning row.
Gets the cell at the specified column index in the owning row.
- index
- Type:number
- The zero-based column index of the cell to get.
Exceptions
Exception Description ig.ArgumentOutOfRangeException index is less than zero. ig.InvalidOperationException If the row was removed from the worksheet. index is greater than or equal to Workbook.maxExcelColumnCount or Workbook.maxExcel2007ColumnCount, depending on the Workbook.currentFormat.Remarks
Note: Iterating the collection will not create all cells. It will only iterate the cells which have already been used. To create and iterate all cells in the worksheet use a For loop, iterating from 0 to one less than the maximum column count, and pass in each index to the collection's indexer.
-
getCellAssociatedDataTable
- .getCellAssociatedDataTable( columnIndex:number );
- Return Type:
- ig.excel.WorksheetDataTable
- Return Type Description:
- The data table to which the cell belongs or null if the cell does not belong to a data table.
Gets the data table to which the cell at the specified index belongs.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException If the row was removed from the worksheet. Remarks
The cells in the left-most column and top-most row of the data table will return null for the associated data table.
If a data table is associated with the cell, getting the value of the cell with WorksheetRow.getCellValue will return the calculated value for the cell.
-
getCellAssociatedMergedCellsRegion
- .getCellAssociatedMergedCellsRegion( columnIndex:number );
- Return Type:
- ig.excel.WorksheetMergedCellsRegion
- Return Type Description:
- The merged cells region which contains the cell at the specified index, or null if the cell is not merged.
Gets the merged cells region which contains the cell at the specified index, or null if the cell is not merged.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException If the row was removed from the worksheet. -
getCellAssociatedTable
- .getCellAssociatedTable( columnIndex:number );
Gets the WorksheetTable to which the cell at the specified index belongs.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
Exceptions
Exception Description ig.InvalidOperationException If the row was removed from the worksheet. Remarks
A cell belongs to a table if it exists in any area of the table. It can be a header cell, total cell, or a cell in the data area.
-
getCellBoundsInTwips
- .getCellBoundsInTwips( columnIndex:number );
- Return Type:
- object
- Return Type Description:
- The bounds of the cell at the specified column index on its worksheet. This will be an object with numeric values for properties 'x', 'y', 'width', 'height', 'left', 'top', 'right', and 'bottom'.
Gets the bounds of the cell at the specified column index in twips (1/20th of a point).
- columnIndex
- Type:number
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException If the row was removed from the worksheet. Remarks
The bounds returned by this method are only valid with the current configuration of the worksheet. If any rows or columns before the cell are resized, these bounds will no longer reflect the position of the cell.
-
getCellBoundsInTwips
- .getCellBoundsInTwips( columnIndex:number, options:ig.excel.PositioningOptions );
- Return Type:
- object
- Return Type Description:
- The bounds of the cell at the specified column index on its worksheet. This will be an object with numeric values for properties 'x', 'y', 'width', 'height', 'left', 'top', 'right', and 'bottom'.
Gets the bounds of the cell at the specified column index in twips (1/20th of a point).
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
- options
- Type:ig.excel.PositioningOptions
- The options to use when getting the bounds of the cell.
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException If the row was removed from the worksheet. Remarks
The bounds returned by this method are only valid with the current configuration of the worksheet. If any rows or columns before the cell are resized, these bounds will no longer reflect the position of the cell.
-
getCellComment
- .getCellComment( columnIndex:number );
- Return Type:
- ig.excel.WorksheetCellComment
- Return Type Description:
- The comment applied to the cell.
Gets or sets the comment applied to the cell at the specified column index.
- columnIndex
- Type:number
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException If the row was removed from the worksheet. See Also
-
getCellConditionalFormat
- .getCellConditionalFormat( columnIndex:number );
- Return Type:
- ig.excel.CellConditionalFormat
- Return Type Description:
- The aggregated condition format for the cell at the specified column index or null if the cell is not contained in any conditional format region.
Gets the cell conditional format for the cell at the specified column index.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException If the row was removed from the worksheet. Remarks
Note: if the cell is contained in one or more conditional format regions but doesn't match any of the criteria an instance of CellConditionalFormat will still be returned but its CellConditionalFormat.hasConditionFormatting property will return null. However, if the sell is not contained in any conditional format region then this method will return null. -
getCellFormat
- .getCellFormat( columnIndex:number );
- Return Type:
- ig.excel.IWorksheetCellFormat
- Return Type Description:
- The cell formatting for the cell at the specified column index.
Gets the cell formatting for the cell at the specified column index.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException If the row was removed from the worksheet. Remarks
Use this method to set cell formatting specific to the cell. If you will be applying the format to numerous cells, see the Workbook.createNewWorksheetCellFormat method for performance considerations.
-
getCellFormula
- .getCellFormula( columnIndex:number );
- Return Type:
- ig.excel.Formula
- Return Type Description:
- The formula which has been applied to the cell or null if no formula has been applied.
Gets the formula which has been applied to the cell at the specified column index.
- columnIndex
- Type:number
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException If the row was removed from the worksheet. Remarks
If a formula has been applied to the cell, getting the value with the WorksheetRow.getCellValue method will return the calculated value of the formula.
-
getCellHyperlink
- .getCellHyperlink( columnIndex:number );
Gets the effective hyperlink on the cell at the specified index.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
Remarks
If multiple hyperlinks are applied to the cell, the last one in the Worksheet.hyperlinks collection will be used.
If the cell has one or more hyperlinks in the Worksheet.hyperlinks collection as well as a formula containing a HYPERLINK function, the last hyperlink from the collection will be used.
If the cell has a hyperlink due to the HYPERLINK function being used in a formula, the returned value will be sealed.
-
getCellText
- .getCellText( columnIndex:number );
Gets the display text in the cell at the specified index.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
Remarks
The display text is based on the value of the cell and the format string applied to the cell.
-
getCellText
- .getCellText( columnIndex:number, textFormatMode:ig.excel.TextFormatMode );
Gets the text in the cell at the specified index.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
- textFormatMode
- Type:ig.excel.TextFormatMode
- The format mode to use when getting the cell text.
Exceptions
Exception Description ig.excel.InvalidEnumArgumentException textFormatMode is not defined in the TextFormatMode enumeration. ig.InvalidOperationException If the row was removed from the worksheet. Remarks
The text is based on the value of the cell and the format string applied to the cell.
-
getCellValue
- .getCellValue( columnIndex:number );
- Return Type:
- object
- Return Type Description:
- The value of the cell.
Gets the value of the cell at the specified column index.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException If the row was removed from the worksheet. Remarks
If this cell belongs to a merged cell region and it is the top-left cell of the region, getting and setting the value will get and set the value of the associated merged cell region. Getting the value of other cells in a merged cell region will always return null. Setting the value of other cells in a merged cell region will have no effect.
If a formula has been applied to the cell or a data table is associated with the cell, getting the Value will return the calculated value of the cell.
The types supported for the value are:
- System.Byte
- System.SByte
- System.Int16
- System.Int64
- System.UInt16
- System.UInt64
- System.UInt32
- System.Int32
- System.Single
- System.Double
- System.Boolean
- System.Char
- System.Enum
- System.Decimal
- System.DateTime
- System.String
- System.Text.StringBuilder
- System.DBNull
- ErrorValue
- FormattedString
See Also
-
getResolvedCellFormat
- .getResolvedCellFormat( columnIndex:number );
- Return Type:
- ig.excel.IWorksheetCellFormat
- Return Type Description:
- A format object describing the actual formatting that will be used when displayed the cell in Microsoft Excel.
Gets the resolved cell formatting for the cell at the specified column index.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException If the row was removed from the worksheet. Remarks
If any cell format properties are the default values on the cell, the values from the owning row's cell format will be used. If those are default, then the values from the owning column's cell format will be used. Otherwise, the workbook default values will be used.
-
height
- .height( );
- Return Type:
- number
- Return Type Description:
- The height of the row in twips (1/20th of a point).
Gets the height of the row in twips (1/20th of a point).
Exceptions
Exception Description ig.InvalidOperationException From the setter if the row was removed from the worksheet. Remarks
If the height of the row is less than zero, the Worksheet.defaultRowHeight of the owning worksheet will be used as the row's height.
The value assigned must be between -1 and 8192. Invalid values will be automatically adjusted to valid values.
-
height
- .height( value:number );
- Return Type:
- number
- Return Type Description:
- The height of the row in twips (1/20th of a point).
Sets the height of the row in twips (1/20th of a point).
- value
- Type:number
Exceptions
Exception Description ig.InvalidOperationException From the setter if the row was removed from the worksheet. Remarks
If the height of the row is less than zero, the Worksheet.defaultRowHeight of the owning worksheet will be used as the row's height.
The value assigned must be between -1 and 8192. Invalid values will be automatically adjusted to valid values.
-
index
- .index( );
- Return Type:
- number
- Return Type Description:
- The 0-based index of the row in the worksheet.
Gets the 0-based index of the row in the worksheet.
-
setCellComment
- .setCellComment( columnIndex:number, comment:ig.excel.WorksheetCellComment );
Sets the comment applied to the cell at the specified column index.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
- comment
- Type:ig.excel.WorksheetCellComment
- The comment to apply to the cell.
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.InvalidOperationException The value applied only has only one anchor cell set. It should have both or neither anchor cells set. ig.InvalidOperationException The value has its WorksheetShape.topLeftCornerCell and WorksheetShape.bottomRightCornerCell anchors set but they are from different worksheets. ig.InvalidOperationException If the row was removed from the worksheet. See Also
-
setCellValue
- .setCellValue( columnIndex:number, value:object );
Sets the value of a cell at the specified column index.
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.
- value
- Type:object
- The value to assign to the cell.
Exceptions
Exception Description ig.ArgumentOutOfRangeException columnIndex is less than zero or greater than or equal to the number of columns in the worksheet. ig.NotSupportedException The assigned value's type is not supported and can't be exported to Excel. ig.InvalidOperationException The value assigned is a Formula. Instead, Formula.applyTo should be called on the Formula, passing in the cell. ig.InvalidOperationException The value assigned is a WorksheetDataTable. Instead, the WorksheetDataTable.cellsInTable should be set to a region containing the cell. ig.InvalidOperationException The value assigned is a FormattedString which is the value another cell or merged cell region. ig.InvalidOperationException The value is assigned and this cell is part of an ArrayFormula or WorksheetDataTable. ig.InvalidOperationException If the row was removed from the worksheet. Remarks
If this cell belongs to a merged cell region and it is the top-left cell of the region, getting and setting the value will get and set the value of the associated merged cell region. Getting the value of other cells in a merged cell region will always return null. Setting the value of other cells in a merged cell region will have no effect.
If a formula has been applied to the cell or a data table is associated with the cell, getting the Value will return the calculated value of the cell.
The types supported for the value are:
- System.Byte
- System.SByte
- System.Int16
- System.Int64
- System.UInt16
- System.UInt64
- System.UInt32
- System.Int32
- System.Single
- System.Double
- System.Boolean
- System.Char
- System.Enum
- System.Decimal
- System.DateTime
- System.String
- System.Text.StringBuilder
- System.DBNull
- ErrorValue
- FormattedString
See Also
-
validateCellValue
- .validateCellValue( columnIndex:number );
- Return Type:
- boolean
- Return Type Description:
- Returns false if the cell has an associated WorksheetCell.dataValidationRule and the current WorksheetCell.value does not pass the validation defined by that rule; otherwise true is returned.
Returns a boolean indicating if the value of the cell is valid considering its associated WorksheetCell.dataValidationRule
- columnIndex
- Type:number
- The 0-based index of the cell within the WorksheetRow.