PivotTableOptions Class
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Server
- Assembly
TXTextControl.TXSheetControl. Api. dll
- Install
dotnet add package TXTextControl..NET 10 and later.TXSheetControl. Server
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
- Derived
- Pivot
Table Definition
Creation settings shared with JavaScript and TypeScript; settings are validated atomically.
Pivot handles are obtained through the owning workbook or worksheet collection.
Members
| Member | Description |
|---|---|
| Name | Workbook-unique portable identifier. |
| Source | Live source binding. |
| Destination | Output worksheet and top-left cell. |
| Rows | Ordered row fields. |
| Columns | Ordered column fields. |
| Values | Ordered measures; duplicate source fields may use different aggregations and captions. |
| Filters | AND-combined filters. |
| CalculatedFields | Record-level calculated fields. |
| Layout | compact, outline, or tabular. |
| Subtotals | top, bottom, or none. |
| RowGrandTotals | Include the grand-total row; defaults to true. |
| ColumnGrandTotals | Include grand-total columns; defaults to true. |
| RepeatLabels | Repeat ancestor labels in tabular/outline output. |
| ShowHeaders | Show the pivot header rows; defaults to true. |
| ShowFieldButtons | Show interactive field buttons in the editor. |
| AutoRefresh | Join source edits with automatic pivot refresh in one undo step. |
| EmptyText | Text displayed for missing aggregate results. |
| Style | Native style and portable colors/banding. |
| ChartBindings | Worksheet charts that follow the refreshed pivot output. |
| Collapsed | Collapsed row/column member paths. |
| MergeLabels | Merge repeated column headers and outline/tabular ancestor row labels; default false. | | CompactIndent | Spaces per compact hierarchy level, 0–20; default 2. | | FilterAreaLayout | Arrange report-only filters above the report. Omitted keeps the existing output layout. | | FilterFieldsPerLine | Fields before wrapping down a column or across a row, 0–64; zero uses one column/row. | | ErrorText | Replacement for source spreadsheet errors and non-finite aggregates; omitted retains normal error behavior. | | AutoFitColumns | Fit output column widths from formatted text on refresh, bounded to 48–360 CSS pixels; default false. | | PreserveFormatting | Retain existing result-cell formatting by position on refresh unless a new pivot style is applied; default false. | | AllowMultipleFiltersPerField | Allow AND-combined filters for the same field; default true. False rejects duplicate field filters. | | UseCustomListsForSorting | Use configured lists and built-in month/day orders before alphabetical axis sorting; default false. | | CustomSortLists | Additional ordered lists used when custom-list sorting is enabled; at most 32 lists of 365 distinct labels. | | ShowExpandCollapseButtons | Display independent row hierarchy expand/collapse controls; default true. | | ShowContextualTooltips | Display field and grid-control context tooltips while retaining accessible labels; default true. | | ClassicLayout | Allow field assignment and reordering by dragging visible grid field headers; default false. | | ShowValuesRow | Show a separate measure-caption header row even for a single measure; default false. | | FieldListSort | Available-field list order; source order by default. Does not reorder the report axes. |
Example
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([
[],
[], ["Europe", "Services", 700, 350],
[], ["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 for field settings, output and lifetime rules.
Constructor
public PivotTableOptions()
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.