Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
PivotTable pt = pivot_ws.PivotTables.CreatePivotTable(data_area, 50, 50);

After creating the PivotTable, always set RefreshOnOpen to true.

...

ExcelWriter does not have the ability to render a PivotTable, so any modifications made to a PivotTable will not take affect until the output file is opened in Excel and the PivotTable is refreshed. If RefreshOnOpen is true, Excel will refresh the PivotTable when the workbook opens, which will re-render the PivotTable.

Step 3. Set

...

PivotTable Properties

There are two types of PivotTable properties:

  1. The equivalents of PivotTable Options in Excel
  2. Other properties, such as name or data source

The properties found in Excel by going to PivotTable Options

Other PivotTable properties - friendly error on value, empty value

...