# DashboardCollection Class

> DashboardCollection class in the TX Sheet Control TypeScript API for Node.js, with 1 property and 9 methods and a TypeScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Class
- **Path:** TX Sheet Control > API Reference > TypeScript API > Node.js Server > DashboardCollection Class
- **1094 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/llms-full.txt

---

Workbook dashboard views; collection edits share the workbook history and .txwb persistence.

Package: `@txtextcontrol/tx-sheet-control-server`. Version: **2.0.0**.

Related workbook object-model type, returned through the server control. Obtain it from its owning workbook or collection; it is not a required browser-package import.

### Members

#### Properties

| Property | Description |
|---|---|
| [count](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/count-property/llms-full.txt) | The count value of DashboardCollection. |

#### Methods

| Method | Description |
|---|---|
| [add](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/add-method/llms-full.txt) | Creates an empty dashboard. Creation never changes viewport selection implicitly. |
| [at](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/at-method/llms-full.txt) | Zero-based index in the dashboard group. |
| [duplicate](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/duplicate-method/llms-full.txt) | Copies widgets, filters and layout to a distinct dashboard identity. |
| [generate](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/generate-method/llms-full.txt) | Generates at most 12 widgets with deterministic field-role rules. Existing customizations require explicit merge/replace. |
| [getById](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/getbyid-method/llms-full.txt) | Resolves a stable identity; throws when the dashboard does not exist. |
| [list](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/list-method/llms-full.txt) | Ordered detached definitions, safe to inspect or use as inputs for explicit edits. |
| [move](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/move-method/llms-full.txt) | Reorders only the dashboard group; index is zero-based. |
| [remove](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/remove-method/llms-full.txt) | Removes a dashboard. Deleting the active view restores the selected worksheet. |
| [setMode](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/setmode-method/llms-full.txt) | Changes the integrated authoring mode; viewing retains filters and chart interactions. |

### Examples

Use a fresh workbook. Create and format the sample data, apply this API and retain the returned document or result in your application. In the browser pass editor.workbook; in Node.js pass the server control.

```typescript
import type { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';

function createDashboardCollectionReport(control: ServerSheetControl) {
    const book = control.workbook;
    const sheet = book.sheets.at(0);
    sheet.range('A1:B5').setValues([
        ['Region', 'Revenue'],
        ['North', 42000],
        ['South', 38500],
        ['East', 31200],
        ['West', 44900],
    ]);

    book.analytics.setSource({
        id: 'sales',
        name: 'Regional sales',
        sheetId: sheet.id,
        range: 'A1:B5',
        hasHeaderRow: true,
    });

    const dashboard = book.dashboards.add('Sales overview');
    dashboard.addWidget({
        id: 'revenue',
        type: 'bar',
        title: 'Revenue by region',
        placement: { x: 0, y: 0, width: 6, height: 4 },
        query: {
            sourceId: 'sales',
            dimensions: ['Region'],
            measures: [{ field: 'Revenue', aggregation: 'SUM', alias: 'Revenue' }],
        },
        drillDown: ['Region'],
        interactions: { filter: true, allowSourceData: true },
    });

    return dashboard.snapshot;
}
```

### See Also

- [TypeScript Node.js Server API](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/llms-full.txt)
- [Creating Dashboards](https://docs.textcontrol.com/tx-sheet-control/dashboards/creating/llms-full.txt)

---

## In This Section

- [DashboardCollection.add Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/add-method/llms-full.txt): DashboardCollection.add method in the TX Sheet Control TypeScript API for Node.js: Creates an empty dashboard. Includes the syntax and a TypeScript example.
- [DashboardCollection.at Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/at-method/llms-full.txt): DashboardCollection.at method in the Node.js TypeScript API: Zero-based index in the dashboard group. Includes the syntax and a TypeScript example.
- [DashboardCollection.count Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/count-property/llms-full.txt): DashboardCollection.count property in the TX Sheet Control TypeScript API for Node.js, with its type number and a TypeScript example.
- [DashboardCollection.duplicate Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/duplicate-method/llms-full.txt): DashboardCollection.duplicate method in the TX Sheet Control TypeScript API for Node.js: Copies widgets, filters and layout to a distinct dashboard identity.
- [DashboardCollection.generate Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/generate-method/llms-full.txt): DashboardCollection.generate method in the TX Sheet Control TypeScript API for Node.js: Generates at most 12 widgets with deterministic field-role rules.
- [DashboardCollection.getById Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/getbyid-method/llms-full.txt): DashboardCollection.getById method in the TX Sheet Control TypeScript API for Node.js: Resolves a stable identity; throws when the dashboard does not exist.
- [DashboardCollection.list Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/list-method/llms-full.txt): DashboardCollection.list method in the Node.js TypeScript API: Ordered detached definitions, safe to inspect or use as inputs for explicit edits.
- [DashboardCollection.move Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/move-method/llms-full.txt): DashboardCollection.move method in the TX Sheet Control TypeScript API for Node.js: Reorders only the dashboard group; index is zero-based.
- [DashboardCollection.remove Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/remove-method/llms-full.txt): DashboardCollection.remove method in the TX Sheet Control TypeScript API for Node.js: Removes a dashboard. Includes the syntax and a TypeScript example.
- [DashboardCollection.setMode Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/setmode-method/llms-full.txt): DashboardCollection.setMode method in the TX Sheet Control TypeScript API for Node.js: Changes the integrated authoring mode.

---

## Nearby

- **Previous:** [DashboardAnalytics.suggestRelationships Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardanalytics/suggestrelationships-method/llms-full.txt)
- **Next:** [DashboardCollection.add Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/dashboardcollection/add-method/llms-full.txt)
