SlicerCollection
SlicerCollection class
Specifies the collection of all the Slicer objects on the specified worksheet.
class SlicerCollection implements Iterable<Slicer>;
Methods
[Symbol.iterator](): Iterator<Slicer>
Returns an iterator over the items in the collection. Enables use of for...of, spread syntax, and Array.from().
get(number)
Gets the Slicer by index.
get(index: number) : Slicer;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | number |
Returns
get(string)
Gets the Slicer by slicer’s name.
get(name: string) : Slicer;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | string |
Returns
remove(Slicer)
Remove the specified Slicer
remove(slicer: Slicer) : void;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| slicer | Slicer | The Slicer object |
removeAt(number)
Deletes the Slicer at the specified index
removeAt(index: number) : void;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | number | The position index in Slicer collection |
clear()
Clear all Slicers.
clear() : void;
add(PivotTable, string, string)
Add a new Slicer using PivotTable as data source
add(pivot: PivotTable, destCellName: string, baseFieldName: string) : number;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pivot | PivotTable | PivotTable object |
| destCellName | string | The cell in the upper-left corner of the Slicer range. |
| baseFieldName | string | The name of PivotField in PivotTable.BaseFields |
Returns
The new add Slicer index
add(PivotTable, number, number, string)
Add a new Slicer using PivotTable as data source
add(pivot: PivotTable, row: number, column: number, baseFieldName: string) : number;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pivot | PivotTable | PivotTable object |
| row | number | Row index of the cell in the upper-left corner of the Slicer range. |
| column | number | Column index of the cell in the upper-left corner of the Slicer range. |
| baseFieldName | string | The name of PivotField in PivotTable.BaseFields |
Returns
The new add Slicer index
add(PivotTable, number, number, number)
Add a new Slicer using PivotTable as data source
add(pivot: PivotTable, row: number, column: number, baseFieldIndex: number) : number;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pivot | PivotTable | PivotTable object |
| row | number | Row index of the cell in the upper-left corner of the Slicer range. |
| column | number | Column index of the cell in the upper-left corner of the Slicer range. |
| baseFieldIndex | number | The index of PivotField in PivotTable.BaseFields |
Returns
The new add Slicer index
add(PivotTable, string, number)
Add a new Slicer using PivotTable as data source
add(pivot: PivotTable, destCellName: string, baseFieldIndex: number) : number;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pivot | PivotTable | PivotTable object |
| destCellName | string | The cell in the upper-left corner of the Slicer range. |
| baseFieldIndex | number | The index of PivotField in PivotTable.BaseFields |
Returns
The new add Slicer index
add(PivotTable, number, number, PivotField)
Add a new Slicer using PivotTable as data source
add(pivot: PivotTable, row: number, column: number, baseField: PivotField) : number;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pivot | PivotTable | PivotTable object |
| row | number | Row index of the cell in the upper-left corner of the Slicer range. |
| column | number | Column index of the cell in the upper-left corner of the Slicer range. |
| baseField | PivotField | The PivotField in PivotTable.BaseFields |
Returns
The new add Slicer index
add(PivotTable, string, PivotField)
Add a new Slicer using PivotTable as data source
add(pivot: PivotTable, destCellName: string, baseField: PivotField) : number;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| pivot | PivotTable | PivotTable object |
| destCellName | string | The cell in the upper-left corner of the Slicer range. |
| baseField | PivotField | The PivotField in PivotTable.BaseFields |
Returns
The new add Slicer index
add(ListObject, number, string)
Add a new Slicer using ListObjet as data source
add(table: ListObject, index: number, destCellName: string) : number;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| table | ListObject | ListObject object |
| index | number | The index of ListColumn in ListObject.ListColumns |
| destCellName | string | The cell in the upper-left corner of the Slicer range. |
Returns
The new add Slicer index
add(ListObject, ListColumn, string)
Add a new Slicer using ListObjet as data source
add(table: ListObject, listColumn: ListColumn, destCellName: string) : number;
Parameters:
| Parameter | Type | Description |
|---|---|---|
| table | ListObject | ListObject object |
| listColumn | ListColumn | The ListColumn in ListObject.ListColumns |
| destCellName | string | The cell in the upper-left corner of the Slicer range. |
Returns
The new add Slicer index
add(ListObject, ListColumn, number, number)
Add a new Slicer using ListObjet as data source
add(table: ListObject, listColumn: ListColumn, row: number, column: number) : number;
Parameters:
Returns
The new add Slicer index
getCount()
@deprecated. Please use the ‘count’ property instead. Gets the number of elements contained in.
getCount() : number;
isNull()
Checks whether the implementation object is null.
isNull() : boolean;
