[]
Sets whether to repeat item labels for all pivot fields in this pivot table.
This setting is applied to all existing pivot fields in the pivot table.
void RepeatAllLabels(PivotFieldRepeatLabels repeat)
Sub RepeatAllLabels(repeat As PivotFieldRepeatLabels)
| Type | Name | Description |
|---|---|---|
| PivotFieldRepeatLabels | repeat | Specifies whether to repeat item labels for all pivot fields in the pivot table. |
worksheet.Range["A1:C5"].Value = new object[,] {
{"Category", "Product", "Amount"},
{"Beverages", "Tea", 100},
{"Beverages", "Coffee", 200},
{"Snacks", "Chips", 150},
{"Snacks", "Nuts", 120}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:C5"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["E1"], "SalesPivot");
pivotTable.PivotFields["Category"].Orientation = PivotFieldOrientation.RowField;
pivotTable.PivotFields["Product"].Orientation = PivotFieldOrientation.RowField;
pivotTable.RepeatAllLabels(PivotFieldRepeatLabels.RepeatLabels);