AnalyticsData 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
Detached tabular snapshot for a direct dashboard connector. Dates use ISO strings.
Syntax
public class AnalyticsData
Members
Constructors
| Constructor | Description |
|---|---|
| Constructor |
Properties
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" }] });
}