ExcelScript.PivotLayoutType enum

注解

示例

/**
 * This script sets the layout of the "Farms Sales" PivotTable to the "tabular"
 * setting. This places the fields from the Rows area in separate columns.
 */ 
function main(workbook: ExcelScript.Workbook) {
  // Get the PivotTable named "Farm Sales".
  const pivot = workbook.getPivotTable("Farm Sales");

  // Get the PivotLayout object.
  const layout = pivot.getLayout();

  // Set the layout type to "tabular".
  layout.setLayoutType(ExcelScript.PivotLayoutType.tabular);
}

字段

compact

水平压缩窗体,其中包含同一列中下一个字段中的标签。

outline

内部字段的项目与外部字段的项目位于同一行中,小计始终位于底部。

tabular

内部字段的项始终位于相对于外部字段项的新行上。