[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IPivotField.RepeatLabels

RepeatLabels Property

RepeatLabels

Gets or sets whether item labels are repeated in the PivotTable for the specified IPivotField.

Use this property to determine whether repeated item labels are shown for the field in the PivotTable layout.

Declaration
bool RepeatLabels { get; set; }
Property RepeatLabels As Boolean
Examples
worksheet.Range["A1:B4"].Value = new object[,] {
    {"Category", "Product"},
    {"Fruit", "Apple"},
    {"Fruit", "Orange"},
    {"Drink", "Tea"}
};
IPivotCache pivotCache = workbook.PivotCaches.Create(worksheet.Range["A1:B4"]);
IPivotTable pivotTable = worksheet.PivotTables.Add(pivotCache, worksheet.Range["D1"]);
IPivotField field = pivotTable.PivotFields["Category"];
field.Orientation = PivotFieldOrientation.RowField;
field.RepeatLabels = true;
bool repeatLabels = field.RepeatLabels;