ExcelScript.FilterPivotHierarchy interface
Representa el filtro de ExcelPivotHierarchy.
Comentarios
Ejemplos
/**
* This script creates a PivotTable with a filter.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the two worksheets to use in PivotTable creation.
const dataSheet = workbook.getWorksheet("Data");
const pivotSheet = workbook.getWorksheet("Pivot");
// Create a new PivotTable.
const newPivot = pivotSheet.addPivotTable(
"My PivotTable",
dataSheet.getUsedRange(),
pivotSheet.getRange("A1"));
// Add a filter with the Quarter field.
const filter: ExcelScript.FilterPivotHierarchy =
newPivot.addFilterHierarchy(newPivot.getHierarchy("Quarter"));
// Add other hierarchies...
}
Métodos
get |
Determina si se permiten varios elementos de filtro. |
get |
Devuelve los PivotFields asociados con FilterPivotHierarchy. |
get |
Identificador de FilterPivotHierarchy. |
get |
Nombre de FilterPivotHierarchy. |
get |
Obtiene un pivotfield por nombre. Si pivotField no existe, este método devuelve |
get |
Posición de la FilterPivotHierarchy. |
set |
Determina si se permiten varios elementos de filtro. |
set |
Nombre de FilterPivotHierarchy. |
set |
Posición de la FilterPivotHierarchy. |
set |
Restablece FilterPivotHierarchy a sus valores predeterminados. |
Detalles del método
getEnableMultipleFilterItems()
Determina si se permiten varios elementos de filtro.
getEnableMultipleFilterItems(): boolean;
Devoluciones
boolean
getFields()
Devuelve los PivotFields asociados con FilterPivotHierarchy.
getFields(): PivotField[];
Devoluciones
getId()
Identificador de FilterPivotHierarchy.
getId(): string;
Devoluciones
string
getName()
Nombre de FilterPivotHierarchy.
getName(): string;
Devoluciones
string
Ejemplos
/**
* This script logs the names of all the filter hierarchies in a PivotTable.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the first PivotTable in the workbook.
const pivotTable = workbook.getPivotTables()[0];
// For each pivot filter, log its name.
pivotTable.getFilterHierarchies().forEach((filter: ExcelScript.FilterPivotHierarchy) => {
console.log(filter.getName());
});
}
getPivotField(name)
Obtiene un pivotfield por nombre. Si pivotField no existe, este método devuelve undefined
.
getPivotField(name: string): PivotField | undefined;
Parámetros
- name
-
string
Nombre del campo dinámico que se va a recuperar.
Devoluciones
ExcelScript.PivotField | undefined
getPosition()
Posición de la FilterPivotHierarchy.
getPosition(): number;
Devoluciones
number
setEnableMultipleFilterItems(enableMultipleFilterItems)
Determina si se permiten varios elementos de filtro.
setEnableMultipleFilterItems(enableMultipleFilterItems: boolean): void;
Parámetros
- enableMultipleFilterItems
-
boolean
Devoluciones
void
setName(name)
Nombre de FilterPivotHierarchy.
setName(name: string): void;
Parámetros
- name
-
string
Devoluciones
void
setPosition(position)
Posición de la FilterPivotHierarchy.
setPosition(position: number): void;
Parámetros
- position
-
number
Devoluciones
void
setToDefault()
Restablece FilterPivotHierarchy a sus valores predeterminados.
setToDefault(): void;
Devoluciones
void