ExcelScript.PivotLayoutType enum

Remarks

Examples

/**
 * 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);
}

Fields

compact

A horizontally compressed form with labels from the next field in the same column.

outline

Inner fields' items are on same row as outer fields' items and subtotals are always on the bottom.

tabular

Inner fields' items are always on a new line relative to the outer fields' items.