Represents a column in a WorksheetTable.

Each column contains various settings for controlling the contents, formatting, sorting, and filtering within it.

Hierarchy

Hierarchy

  • Base
    • WorksheetTableColumn

Implements

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get columnFormula(): Formula
  • Gets the formula associated with the data area of the column.

    When the column formula is set and the table is resized to give it more rows, the new cells in the column will have the column formula applied to them.

    A Formula instance representing the formula for the data area of the column or null if no formula is applied.

    See

    setColumnFormula

    Returns Formula

  • get dataAreaRegion(): WorksheetRegion
  • Gets the WorksheetRegion which represents the region of cells in the data area of the column.

    Returns WorksheetRegion

  • get index(): number
  • Gets the 0-based index of the column in the owning WorksheetTable.columns collection. The 0-based index of the column in its collection or -1 if the column has been removed from the table.

    See

    WorksheetTable.columns

    Returns number

  • get name(): string
  • Gets or sets the name of the column.

    If the header row is visible in the WorksheetTable, the name of the column will be displayed in the cell of the column in the header row.

    When the WorksheetTable is created, the column names will be taken from the cells in the header row. If the table does not contain a header row, the column names will be generated.

    The column names are unique within the owning WorksheetTable. If, when the table is created, there are two or more columns with the same name, the second and subsequent duplicate column names will have a number appended to make them unique. If any cells in the header row have a non-string value, their value will be changed to a string (the current display text of the cell). If any cells in the header row have no value, they will be given a generated column name.

    If the Name property is set to a null or empty string, a column name will be generated. If the value is set to a column name which already exists in the table, the column with the higher index will have a number appended to its name so all column names can stay unique.

    The unique name of the column within the owning WorksheetTable.

    Throws

    InvalidOperationException From the setter if column was removed from the table.

    See

    WorksheetTable.isHeaderRowVisible

    Returns string

  • set name(a: string): void
  • Parameters

    • a: string

    Returns void

  • get sortCondition(): SortCondition
  • Gets or sets the sort condition used to sort the column in the table.

    When a sort condition is set on the column, the SortConditions collection on the WorksheetTable.sortSettings will be cleared and the new sort condition will be added. To sort by multiple columns, the sort conditions must be added to the SortConditions collection instead of set on the column. However, if a sort condition is cleared with this property, just the sort condition for the column will be removed from the SortConditions collection. All other SortConditions will remain in the collection.

    Note: Sort conditions are not constantly evaluated as data within the table changes. Sort conditions are applied to the table only when they are are added or removed on a column in the table or when the WorksheetTable.reapplySortConditions method is called.

    The sortCondition-derived instance used to sort the column or null of the column is not sorted.

    Throws

    InvalidOperationException From the setter if column was removed from the table.

    See

    Returns SortCondition

  • set sortCondition(a: SortCondition): void
  • Parameters

    Returns void

  • get table(): WorksheetTable
  • Gets the WorksheetTable to which the column belongs. The WorksheetTable to which the column belongs or null if the column has been removed from the table.

    Returns WorksheetTable

  • get totalFormula(): Formula
  • Gets or sets the formula to use in the total cell of the column.

    The total formula can be set regardless of whether or not the totals row is visible. If the totals row is hidden, the formula will not be applied anywhere. When the totals row is visible, it will be applied to the total cell of the column.

    Setting the TotalFormula to a non-null value will clear the totalLabel, and vice versa.

    Throws

    ArgumentException The value is already applied to something else, such as a cell or table column.

    Throws

    InvalidOperationException From the setter if column was removed from the table.

    See

    Returns Formula

  • set totalFormula(a: Formula): void
  • Parameters

    Returns void

  • get totalLabel(): string
  • Gets or sets the text label to use in the total cell of the column.

    The total label can be set regardless of whether or not the totals row is visible. If the totals row is hidden, the label will not be displayed anywhere. When the totals row is visible, it will be set as the value of the total cell of the column.

    Setting the totalFormula to a non-null value will clear the TotalLabel, and vice versa.

    Throws

    InvalidOperationException From the setter if column was removed from the table.

    See

    Returns string

  • set totalLabel(a: string): void
  • Parameters

    • a: string

    Returns void

  • get wholeColumnRegion(): WorksheetRegion
  • Gets the WorksheetRegion which represents the region of cells in the whole column, including the header and total cells, if visible.

    Returns WorksheetRegion

Methods

  • Applies a CustomFilter to the column.

    Note: If the filter condition value is longer than 255 characters in length and the workbook is saved in one of the 2003 formats, the correct rows will be hidden in the saved file, but the filter will be missing from the column.

    Throws

    ArgumentNullException 'condition' is null.

    Throws

    InvalidOperationException The WorksheetTable.isFilterUIVisible value of the owning table is False. Filters cannot be applied when the header row or filter button is hidden.

    Throws

    InvalidOperationException If column was removed from the table.

    See

    Parameters

    Returns CustomFilter

  • Applies a CustomFilter to the column.

    If 'condition2' is null, the 'conditionalOperator' value is irrelevant.

    Note: If one of the filter condition values is longer than 255 characters in length and the workbook is saved in one of the 2003 formats, the correct rows will be hidden in the saved file, but the filter will be missing from the column.

    Throws

    ArgumentNullException 'condition1' is null.

    Throws

    InvalidEnumArgumentException 'conditionalOperator' is not defined in the ConditionalOperator enumeration.

    Throws

    InvalidOperationException The WorksheetTable.isFilterUIVisible value of the owning table is False. Filters cannot be applied when the header row or filter button is hidden.

    See

    Parameters

    Returns CustomFilter

  • Applies an DatePeriodFilter to the column.

    If the 'type' is Month, a 'value' of 1 indicates January, 2 indicates February, and so on. If type is Quarter, a value of 1 indicates Quarter 1, and so on.

    Throws

    InvalidEnumArgumentException 'type' is not defined in the DatePeriodFilterType enumeration.

    Throws

    ArgumentException 'type' is Quarter and 'value' is less than 1 or greater than 4 or type is Month and value is less than 1 or greater than 12.

    Throws

    InvalidOperationException The WorksheetTable.isFilterUIVisible value of the owning table is False. Filters cannot be applied when the header row or filter button is hidden.

    Throws

    InvalidOperationException If column was removed from the table.

    See

    Parameters

    • type: DatePeriodFilterType

      The type of date period to filter in.

    • value: number

      The 1-based value of the month or quarter to filter in.

    Returns DatePeriodFilter

  • Applies a FillFilter to the column.

    Throws

    ArgumentNullException 'fill' is null.

    Throws

    InvalidOperationException The WorksheetTable.isFilterUIVisible value of the owning table is False. Filters cannot be applied when the header row or filter button is hidden.

    Throws

    InvalidOperationException If column was removed from the table.

    See

    Parameters

    Returns FillFilter

  • Applies a FixedValuesFilter to the column.

    Throws

    ArgumentNullException 'dateGroups' is null.

    Throws

    InvalidEnumArgumentException 'calendarType' is not defined in the CalendarType enumeration.

    Throws

    ArgumentNullException A FixedDateGroup in the 'dateGroups' collection is null.

    Throws

    ArgumentException Multiple items in 'dateGroups' are equal to each other.

    Throws

    InvalidOperationException 'includeBlanks' is False and 'dateGroups' has no items. At least one value must be allowed.

    Throws

    InvalidOperationException The WorksheetTable.isFilterUIVisible value of the owning table is False. Filters cannot be applied when the header row or filter button is hidden.

    See

    Parameters

    • includeBlanks: boolean

      The value which indicates whether blank cells should be filtered in.

    • calendarType: CalendarType

      The calendar type used to interpret values in the 'dateGroups' collection.

    • Rest ...dateGroups: FixedDateGroup[]

      The collection of fixed date groups which should be filtered in.

    Returns FixedValuesFilter

  • Parameters

    • other: any

    Returns boolean

  • Returns number

  • Sets the formula to use in the data cells in the column.

    If any relative cell or region references are in the specified formula, it will be assumed that the actual formula is being applied to the first data cell in the column. When the formula is applied to other cells in the column, the relative references will be offset by the appropriate amount.

    When the column formula is set and the table is resized to give it more rows, the new cells in the column will have the column formula applied to them.

    If there was a different column formula applied previously and it was applied to any of the cells in the column, setting it to a different formula will overwrite the formulas on those cells, regardless of the value of 'overwriteExistingValues'.

    Throws

    ArgumentException

    Throws

    InvalidOperationException If column was removed from the table. 'formula' is already applied to something else, such as a cell or table column.

    See

    columnFormula

    Parameters

    • formula: Formula

      The formula for the data cells of the column or null to remove the current column formula.

    • overwriteExistingValues: boolean

      True to overwrite the existing cells values and apply the formula to all data cells in the column. False to only apply the formula to the cells with no value set.

    Returns void

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns boolean