# PivotAxisField Class

> PivotAxisField class in the TX Sheet Control .NET API: One row or column field and its presentation. 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 > PivotAxisField Class
- **1012 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/llms-full.txt

---

One row or column field and its presentation.

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

### Members

| Member | Description |
|---|---|
| [Field](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/field-property/llms-full.txt) | Source or calculated field name. |
| [Caption](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/caption-property/llms-full.txt) | Optional display caption. |
| [Sort](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/sort-property/llms-full.txt) | ascending, descending, or source. |
| [SortByValue](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/sortbyvalue-property/llms-full.txt) | Optional measure caption for value-based sorting. |
| [Grouping](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/grouping-property/llms-full.txt) | Optional date, numeric, or manual grouping. |

### 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 PivotAxisField()
```

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

- [PivotAxisField.Caption Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/caption-property/llms-full.txt): PivotAxisField.Caption property in the TX Sheet Control .NET API: Optional display caption. Shown with its type string? and a C# example.
- [PivotAxisField.Field Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/field-property/llms-full.txt): PivotAxisField.Field property in the TX Sheet Control .NET API: Source or calculated field name. Shown with its type string and a C# example.
- [PivotAxisField.Grouping Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/grouping-property/llms-full.txt): PivotAxisField.Grouping property in the TX Sheet Control .NET API, with its syntax, its type PivotGrouping? and a C# example.
- [PivotAxisField.Sort Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/sort-property/llms-full.txt): PivotAxisField.Sort property in the TX Sheet Control .NET API: ascending, descending, or source. Shown with its type string? and a C# example.
- [PivotAxisField.SortByValue Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/sortbyvalue-property/llms-full.txt): PivotAxisField.SortByValue property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.

---

## Nearby

- **Previous:** [PivotTableCollection.RefreshAllAsync Method](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivottablecollection/refreshallasync-method/llms-full.txt)
- **Next:** [PivotAxisField.Field Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/pivotaxisfield/field-property/llms-full.txt)
