TX Sheet Control

PivotTableOptions.ErrorText Property

Property
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server as TXTextControl.TXSheetControl.Api.dll from the private NuGet feed or the supplied NuGet folder
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll

Replacement for source spreadsheet errors and non-finite aggregates; omitted retains normal error behavior.

Syntax

public string? ErrorText { get; init; }

Property Value

A string of at most 1,024 characters. An empty string is allowed. Objects, arrays and longer text reject creation or update without changing the report.

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([
    ["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 Summary");
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" }, new() { Field = "Category" }],
    Values = [new() { Field = "Revenue", Caption = "Sales", NumberFormatCode = "$#,##0.00" }], Layout = "tabular"
});

await pivot.UpdateAsync(new { errorText = "Not available" });
await source.Cell("C2").SetFormulaAsync("=1/0");
await pivot.RefreshAsync();

See Pivot Tables for the options dialog, Show controls, refresh semantics and export behavior.