Class: FormatConditionalAppearances

FormatConditionalAppearances(oPivot)

new FormatConditionalAppearances(oPivot)

The FormatConditionalAppearances object holds the conditional-formats to apply on the pivot control. For instance, you can change the visual-appearance for positive values only. The FormatConditionalAppearances / GetFormatConditionalAppearances() method returns the control's format-appearances that defines the visual-appearance to apply on pivot-columns, based on conditions.

By default, the FormatConditionalAppearances collection contains the following objects:

  • "negative", to show negative-numbers in red
  • "positive", to show positive-numbers in green
Parameters:
Name Type Description
oPivot Pivot Indicates an object of Pivot type that owns the collection
Example
The following sample shows the 0-cells in black and white:

oPivot.FormatConditionalAppearances.Add(
{
 key: "zero",
 shape: {fillColor: "black",tfi: {fgColor: "white"}},
 expression: "value = 0"
})

Methods

Add(oFormatOptions) → {FormatOptions}

The Add() method adds/updates the format based on its key
Parameters:
Name Type Description
oFormatOptions object Indicates an object of FormatOptions type that holds attributes of the format to add/replace
Returns:
Returns undefined (no key provided), or an the object being added of FormatOptions type that holds attributes of the format being added
Type
FormatOptions

Clear()

The Clear() method clears the FormatOptions objects within the collection

forEach(callback, thisArg)

The forEach() method enumerates the FormatOptions objects within the current collection
Parameters:
Name Type Description
callback callback Indicates a function of callback(oFormatOptions) type, where
oFormatOptions {object}, indicates the format of FormatOptions type
thisArg any Specifies the value of "this" keyword during the callback. If missing it refers to the current collection.

GetCount() → {number}

The GetCount() method returns the number of FormatOptions objects within the collection
Returns:
Returns the number of FormatConditionalAppearances within the collection
Type
number

Item(key) → {FormatOptions}

The Item() property gets the format based on the key
Parameters:
Name Type Description
key string Specifies the key of the format to request
Returns:
Returns undefined (no format found), or an the object being added of FormatOptions type that holds attributes of the format being added
Type
FormatOptions

Remove(key) → {boolean}

The Remove() method removes the format giving its key
Parameters:
Name Type Description
key string Specifies the key of the format to remove
Returns:
Returns true, if the key has been removed
Type
boolean