ExcelScript.RowColumnPivotHierarchy interface

Excel RowColumnPivotHierarchy を表します。

注釈

/**
 *  This sample sorts the rows of a PivotTable.
 */
function main(workbook: ExcelScript.Workbook) {
  // Get an existing PivotTable.
  const pivotTable = workbook.getPivotTable("Farm Sales");

  // Get the data hierarchy to use as the basis of the sort.
  const valueFieldToSortOn: ExcelScript.DataPivotHierarchy = pivotTable.getDataHierarchy("Sum of Crates Sold Wholesale");

  // Get the row to sort.
  const rowToSort: ExcelScript.RowColumnPivotHierarchy = pivotTable.getRowHierarchy("Farm");

  // Sort the "Farm" row's only field by the values in "Sum of Crates Sold Wholesale".
  rowToSort.getFields()[0].sortByValues(ExcelScript.SortBy.descending, valueFieldToSortOn);
}

メソッド

getFields()

RowColumnPivotHierarchy に関連付けられているピボット フィールドを返します。

getId()

RowColumnPivotHierarchy の ID。

getName()

RowColumnPivotHierarchy の名前。

getPivotField(name)

名前で PivotField を取得します。 PivotField が存在しない場合、このメソッドは を返します undefined

getPosition()

RowColumnPivotHierarchy の位置。

setName(name)

RowColumnPivotHierarchy の名前。

setPosition(position)

RowColumnPivotHierarchy の位置。

setToDefault()

RowColumnPivotHierarchy を既定値にリセットします。

メソッドの詳細

getFields()

RowColumnPivotHierarchy に関連付けられているピボット フィールドを返します。

getFields(): PivotField[];

戻り値

getId()

RowColumnPivotHierarchy の ID。

getId(): string;

戻り値

string

getName()

RowColumnPivotHierarchy の名前。

getName(): string;

戻り値

string

getPivotField(name)

名前で PivotField を取得します。 PivotField が存在しない場合、このメソッドは を返します undefined

getPivotField(name: string): PivotField | undefined;

パラメーター

name

string

取得する PivotField の名前。

戻り値

getPosition()

RowColumnPivotHierarchy の位置。

getPosition(): number;

戻り値

number

setName(name)

RowColumnPivotHierarchy の名前。

setName(name: string): void;

パラメーター

name

string

戻り値

void

setPosition(position)

RowColumnPivotHierarchy の位置。

setPosition(position: number): void;

パラメーター

position

number

戻り値

void

setToDefault()

RowColumnPivotHierarchy を既定値にリセットします。

setToDefault(): void;

戻り値

void