TX Sheet Control

AnalyticsData Class

Class
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server from the private NuGet feed or the supplied NuGet folder
Assembly
TXTextControl.TXSheetControl.Api.dll
Install
dotnet add package TXTextControl.TXSheetControl.Server .NET 10 and later.
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll

Detached tabular snapshot for a direct dashboard connector. Dates use ISO strings.

Syntax

public class AnalyticsData

Members

Constructors

ConstructorDescription
Constructor

Properties

PropertyDescription
ColumnsUnique stable field IDs, in row order (maximum 256).
RowsRectangular scalar rows; at most 250,000 cells. Not saved in workbook files.

Examples

Create a working report from bounded HTTP sales data. Supply an application-owned HttpClient and service URL; scope cached data to its actual audience.

using TXTextControl.TXSheetControl.Server;

async Task<AnalyticsResult> BuildAnalyticsDataExampleAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await book.Analytics.SetSourceAsync(new AnalyticsSource { Id = "sales", Name = "Regional sales", ConnectionId = "sales-service", QueryId = "regional-sales" });

    var snapshot = new AnalyticsData { Columns = ["Region", "Revenue"], Rows = [["North", 42000], ["South", 38500]] };
    await book.Analytics.SetDataAsync("sales", snapshot);
    return await book.Analytics.QueryAsync(new AnalyticsQuery { SourceId = "sales", Dimensions = ["Region"], Measures = [new AnalyticsMeasure { Field = "Revenue", Aggregation = "SUM", Alias = "Revenue" }] });
}

See Also