AddTotals (Method)

Applies To:

PivotLabels (TopLabels and SideLabels collections)

Description:

Creates an additional row or column containing the totals for all columns or rows of the pivot.

Syntax:

Expression.AddTotals()

Expression Required:

An expression that returns a PivotLabel object

Example 1:

This example shows how to total the top label columns called Product:

ActiveDocument.Sections["Pivot"].TopLabels["Product Id"].AddTotals()

Example 2:

This example shows how to add a total to the side label rows called Quarter:

ActiveDocument.Sections["Pivot"].SideLabels["Quarter"].AddTotals()