# PivotStyle Class

> PivotStyle class in the TX Sheet Control .NET API: Portable pivot colors, banding and Excel style identity. Shown with a C# example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Namespace:** `TXTextControl.TXSheetControl.Server`
- **Package:** `TXTextControl.TXSheetControl.Server` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Package:** `TXTextControl.TXSheetControl.Blazor` (assembly `TXTextControl.TXSheetControl.Api.dll`, from the private NuGet feed or the supplied NuGet folder)
- **Path:** TX Sheet Control > API Reference > .NET API > TXTextControl.TXSheetControl.Server > PivotStyle Class
- **1138 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/llms-full.txt

---

Portable pivot colors, banding and Excel style identity.

Pivot handles are obtained through the owning workbook or worksheet collection.

### Members

| Member | Description |
|---|---|
| [Name](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/name-property/llms-full.txt) | Shared table preset such as `TableStyleDark2`, native Excel PivotStyle identity, or an empty name to clear the preset. Explicit colors override the preset. |
| [HeaderColor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/headercolor-property/llms-full.txt) | Header fill as #RRGGBB. |
| [HeaderTextColor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/headertextcolor-property/llms-full.txt) | Header text as #RRGGBB. |
| [SubtotalColor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/subtotalcolor-property/llms-full.txt) | Subtotal fill as #RRGGBB. |
| [GrandTotalColor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/grandtotalcolor-property/llms-full.txt) | Grand-total fill as #RRGGBB. |
| [BandColor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/bandcolor-property/llms-full.txt) | Alternating band fill as #RRGGBB. |
| [RowBanding](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/rowbanding-property/llms-full.txt) | Apply alternating row fill. |
| [ColumnBanding](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/columnbanding-property/llms-full.txt) | Apply alternating column fill. |

### Example

```csharp
using TXTextControl.TXSheetControl.Server;

await using var control = new ServerSheetControl();
var workbook = control.Workbook;
var source = await workbook.Sheets.AtAsync(0);
await source.Range("A1:D5").SetValuesAsync([
    ["Region", "Category", "Revenue", "Cost"],
    ["Europe", "Software", 1250, 500], ["Europe", "Services", 700, 350],
    ["Americas", "Software", 1800, 900], ["Americas", "Services", 950, 400]
]);
var report = await workbook.Sheets.AddAsync("Sales Pivot");
var pivot = await report.PivotTables.AddAsync(new PivotTableOptions {
    Name = "RegionalSales", Source = new() { SheetId = source.Id, Range = "A1:D5" },
    Destination = new() { SheetId = report.Id, Cell = "B3" },
    Rows = [new() { Field = "Region" }], Columns = [new() { Field = "Category" }],
    Values = [new() { Field = "Revenue", Caption = "Sales", NumberFormatCode = "$#,##0.00" }]
});
```

See [Pivot Tables](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/pivot-tables/llms-full.txt) for field settings, output and lifetime rules.

### Constructor

```csharp
public PivotStyle()
```

Creates an instance with the property defaults shown in this reference. Settings are validated when applied to the owning document; result objects obtained from document operations are detached snapshots.

---

## In This Section

- [PivotStyle.BandColor Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/bandcolor-property/llms-full.txt): PivotStyle.BandColor property in the TX Sheet Control .NET API: Alternating band fill as #RRGGBB. Shown with its type string? and a C# example.
- [PivotStyle.ColumnBanding Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/columnbanding-property/llms-full.txt): PivotStyle.ColumnBanding property in the TX Sheet Control .NET API: Apply alternating column fill. Shown with its type "true" and a C# example.
- [PivotStyle.GrandTotalColor Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/grandtotalcolor-property/llms-full.txt): PivotStyle.GrandTotalColor property in the TX Sheet Control .NET API: Grand-total fill as #RRGGBB. Shown with its type string? and a C# example.
- [PivotStyle.HeaderColor Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/headercolor-property/llms-full.txt): PivotStyle.HeaderColor property in the TX Sheet Control .NET API: Header fill as #RRGGBB. Shown with its type string? and a C# example.
- [PivotStyle.HeaderTextColor Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/headertextcolor-property/llms-full.txt): PivotStyle.HeaderTextColor property in the TX Sheet Control .NET API: Header text as #RRGGBB. Shown with its type string? and a C# example.
- [PivotStyle.Name Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/name-property/llms-full.txt): PivotStyle.Name property in the .NET API: Table style preset such as TableStyleDark2, or an empty name to clear it; explicit colors override it.
- [PivotStyle.RowBanding Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/rowbanding-property/llms-full.txt): PivotStyle.RowBanding property in the TX Sheet Control .NET API: Apply alternating row fill. Shown with its type "true" and a C# example.
- [PivotStyle.SubtotalColor Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/subtotalcolor-property/llms-full.txt): PivotStyle.SubtotalColor property in the TX Sheet Control .NET API: Subtotal fill as #RRGGBB. Shown with its type string? and a C# example.

---

## Nearby

- **Previous:** [PivotSource.NamedRange Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotsource/namedrange-property/llms-full.txt)
- **Next:** [PivotStyle.Name Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotstyle/name-property/llms-full.txt)
