# AnalyticsSource Class

> AnalyticsSource class in the TX Sheet Control .NET API: A worksheet table/name/range binding or a logical server connector query without a worksheet.

- **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 > AnalyticsSource Class
- **1107 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/llms-full.txt

---

A worksheet table/name/range binding or a logical server connector query without a worksheet.

### Syntax

```csharp
public class AnalyticsSource
```

### Members

#### Constructors

| Constructor | Description |
|---|---|
| [Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/constructor/llms-full.txt) |  |

#### Properties

| Property | Description |
|---|---|
| [ConnectionId](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/connectionid-property/llms-full.txt) | Logical server connection ID; credentials and query text are never stored here. |
| [HasHeaderRow](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/hasheaderrow-property/llms-full.txt) | HasHeaderRow value; validation is applied by the owning workbook operation. |
| [Id](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/id-property/llms-full.txt) | Id value; validation is applied by the owning workbook operation. |
| [Name](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/name-property/llms-full.txt) | Name value; validation is applied by the owning workbook operation. |
| [NamedRange](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/namedrange-property/llms-full.txt) | NamedRange value; validation is applied by the owning workbook operation. |
| [QueryId](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/queryid-property/llms-full.txt) | Server-registered query ID, resolved by the optional data package. |
| [Range](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/range-property/llms-full.txt) | Range value; validation is applied by the owning workbook operation. |
| [SheetId](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/sheetid-property/llms-full.txt) | Worksheet identity for worksheet bindings; omitted for direct connector sources. |
| [TableId](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/tableid-property/llms-full.txt) | TableId value; validation is applied by the owning workbook operation. |

### Examples

Apply AnalyticsSource to a small working document, then return the exported bytes. The caller can save or download the result.

```csharp
using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateAnalyticsSourceReportAsync(ServerSheetControl control)
{
    var book = control.Workbook;
    var sheet = await book.Sheets.AtAsync(0);
    await sheet.Range("A1:B5").SetValuesAsync(new object?[][]
    {
        ["Region", "Revenue"], ["North", 42000], ["South", 38500], ["East", 31200], ["West", 44900]
    });

    var settings = new AnalyticsSource()
    {
        HasHeaderRow = true,
        Id = "sales",
        Name = "Regional sales",
        Range = "A1:B5",
        SheetId = sheet.Id
    };

    await book.Analytics.SetSourceAsync(settings);
    return await control.SaveAsync(StreamType.InternalWorkbookFormat);
}
```

### See Also

- [TXTextControl.TXSheetControl.Server Namespace](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/llms-full.txt)
- [Creating Dashboards](https://docs.textcontrol.com/tx-sheet-control/dashboards/creating/llms-full.txt)

---

## In This Section

- [AnalyticsSource.ConnectionId Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/connectionid-property/llms-full.txt): AnalyticsSource.ConnectionId property in the TX Sheet Control .NET API: Logical server connection ID; credentials and query text are never stored here.
- [AnalyticsSource Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/constructor/llms-full.txt): AnalyticsSource constructor in the TX Sheet Control .NET API, with its syntax, a C# example and remarks on awaiting tasks and handles.
- [AnalyticsSource.HasHeaderRow Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/hasheaderrow-property/llms-full.txt): AnalyticsSource.HasHeaderRow property in the TX Sheet Control .NET API, with its syntax, its type bool? and a C# example.
- [AnalyticsSource.Id Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/id-property/llms-full.txt): AnalyticsSource.Id property in the TX Sheet Control .NET API: Id value; validation is applied by the owning workbook operation.
- [AnalyticsSource.Name Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/name-property/llms-full.txt): AnalyticsSource.Name property in the TX Sheet Control .NET API: Name value; validation is applied by the owning workbook operation.
- [AnalyticsSource.NamedRange Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/namedrange-property/llms-full.txt): AnalyticsSource.NamedRange property in the TX Sheet Control .NET API, with its syntax, its type string? and a C# example.
- [AnalyticsSource.QueryId Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/queryid-property/llms-full.txt): AnalyticsSource.QueryId property in the TX Sheet Control .NET API: Server-registered query ID, resolved by the optional data package.
- [AnalyticsSource.Range Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/range-property/llms-full.txt): AnalyticsSource.Range property in the TX Sheet Control .NET API: Range value; validation is applied by the owning workbook operation.
- [AnalyticsSource.SheetId Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/sheetid-property/llms-full.txt): AnalyticsSource.SheetId property in the TX Sheet Control .NET API: Worksheet identity for worksheet bindings; omitted for direct connector sources.
- [AnalyticsSource.TableId Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/tableid-property/llms-full.txt): AnalyticsSource.TableId property in the TX Sheet Control .NET API: TableId value; validation is applied by the owning workbook operation.

---

## Nearby

- **Previous:** [AnalyticsSort.Field Property](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssort/field-property/llms-full.txt)
- **Next:** [AnalyticsSource Constructor](https://docs.textcontrol.com/tx-sheet-control/reference/dotnet-api/txtextcontrol-txsheetcontrol-server/analyticssource/constructor/llms-full.txt)
