Page tree

Versions Compared

Key

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

...

Note

In Excel, a calculated field is a type of row or column label that is automatically generated when two or more data fields exist in the PivotTable. Calculated fields cannot be modified except to change whether the calculated field is a row label or a column label. Excel handles this by disabling access to the calculate fields' properties.

ExcelWriter will return null or default values for each PivotTableField property. Trying to set these properties will result in an exception. For more information on the values returned by calculated fields, please refer to THIS ANSWERS POST.

Completed Code

And that concludes how to create a basic PivotTable. Here is the full sample code below:

...