Enum PivotTableStyleType

PivotTableStyleType enumeration

Represents the pivot table style type.

public enum PivotTableStyleType

Values

NameValueDescription
None0
PivotTableStyleLight11
PivotTableStyleLight22
PivotTableStyleLight33
PivotTableStyleLight44
PivotTableStyleLight55
PivotTableStyleLight66
PivotTableStyleLight77
PivotTableStyleLight88
PivotTableStyleLight99
PivotTableStyleLight1010
PivotTableStyleLight1111
PivotTableStyleLight1212
PivotTableStyleLight1313
PivotTableStyleLight1414
PivotTableStyleLight1515
PivotTableStyleLight1616
PivotTableStyleLight1717
PivotTableStyleLight1818
PivotTableStyleLight1919
PivotTableStyleLight2020
PivotTableStyleLight2121
PivotTableStyleLight2222
PivotTableStyleLight2323
PivotTableStyleLight2424
PivotTableStyleLight2525
PivotTableStyleLight2626
PivotTableStyleLight2727
PivotTableStyleLight2828
PivotTableStyleMedium129
PivotTableStyleMedium230
PivotTableStyleMedium331
PivotTableStyleMedium432
PivotTableStyleMedium533
PivotTableStyleMedium634
PivotTableStyleMedium735
PivotTableStyleMedium836
PivotTableStyleMedium937
PivotTableStyleMedium1038
PivotTableStyleMedium1139
PivotTableStyleMedium1240
PivotTableStyleMedium1341
PivotTableStyleMedium1442
PivotTableStyleMedium1543
PivotTableStyleMedium1644
PivotTableStyleMedium1745
PivotTableStyleMedium1846
PivotTableStyleMedium1947
PivotTableStyleMedium2048
PivotTableStyleMedium2149
PivotTableStyleMedium2250
PivotTableStyleMedium2351
PivotTableStyleMedium2452
PivotTableStyleMedium2553
PivotTableStyleMedium2654
PivotTableStyleMedium2755
PivotTableStyleMedium2856
PivotTableStyleDark157
PivotTableStyleDark258
PivotTableStyleDark359
PivotTableStyleDark460
PivotTableStyleDark561
PivotTableStyleDark662
PivotTableStyleDark763
PivotTableStyleDark864
PivotTableStyleDark965
PivotTableStyleDark1066
PivotTableStyleDark1167
PivotTableStyleDark1268
PivotTableStyleDark1369
PivotTableStyleDark1470
PivotTableStyleDark1571
PivotTableStyleDark1672
PivotTableStyleDark1773
PivotTableStyleDark1874
PivotTableStyleDark1975
PivotTableStyleDark2076
PivotTableStyleDark2177
PivotTableStyleDark2278
PivotTableStyleDark2379
PivotTableStyleDark2480
PivotTableStyleDark2581
PivotTableStyleDark2682
PivotTableStyleDark2783
PivotTableStyleDark2884
Custom85

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using Aspose.Cells.Pivot;
    using System;

    public class PivotTableStyleTypeDemo
    {
        public static void PivotTableStyleTypeExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Add sample data to the worksheet
            worksheet.Cells[0, 0].Value = "Fruit";
            worksheet.Cells[0, 1].Value = "Year";
            worksheet.Cells[0, 2].Value = "Amount";
            worksheet.Cells[1, 0].Value = "Apple";
            worksheet.Cells[1, 1].Value = 2020;
            worksheet.Cells[1, 2].Value = 50;
            worksheet.Cells[2, 0].Value = "Banana";
            worksheet.Cells[2, 1].Value = 2020;
            worksheet.Cells[2, 2].Value = 60;
            worksheet.Cells[3, 0].Value = "Cherry";
            worksheet.Cells[3, 1].Value = 2021;
            worksheet.Cells[3, 2].Value = 70;
            worksheet.Cells[4, 0].Value = "Date";
            worksheet.Cells[4, 1].Value = 2021;
            worksheet.Cells[4, 2].Value = 80;

            // Add a pivot table to the worksheet
            PivotTableCollection pivotTables = worksheet.PivotTables;
            int pivotIndex = pivotTables.Add("=Sheet1!A1:C5", "E3", "PivotTable1");
            PivotTable pivotTable = pivotTables[pivotIndex];

            // Add fields to the pivot table
            pivotTable.AddFieldToArea(PivotFieldType.Row, 0); // Fruit
            pivotTable.AddFieldToArea(PivotFieldType.Column, 1); // Year
            pivotTable.AddFieldToArea(PivotFieldType.Data, 2); // Amount

            // Set the pivot table style type
            pivotTable.PivotTableStyleType = PivotTableStyleType.PivotTableStyleMedium10;

            // Save the workbook
            workbook.Save("PivotTableStyleTypeExample.xlsx");

            return;
        }
    }
}

See Also