TX Sheet Control

Spreadsheet Class

Class

Coordinates the editor lifecycle and delegates document and interaction behavior to focused operations.

Package: @txtextcontrol/tx-sheet-control/angular. Version: 2.0.0.

ES module import: import { Spreadsheet } from '@txtextcontrol/tx-sheet-control';.

Constructor

new Spreadsheet(host: HTMLElement, options?: SpreadsheetOptions): SpreadsheetInstance
ParameterTypeOptionalDescription
hostHTMLElementNoValue matching host's declared type and the owning object's validation rules.
optionsSpreadsheetOptions | undefinedYesSupported settings for this operation; omitted settings retain documented defaults.

Returns: SpreadsheetInstance.

Members

Properties

PropertyDescription
hostThe host value of Spreadsheet.
licenseInfoImmutable signed customer entitlement and current trial validity.
readyResolves after discovery, font-picker initialization and initial document fonts; rejects on failure.
uiThe ui value of Spreadsheet.
userNameCurrent comment author, shared with this control's workbook runtime.
workbookThe workbook value of Spreadsheet.

Methods

MethodDescription
destroyThe destroy operation of Spreadsheet.
loadLoads XLSX/TXWB bytes or CSV/XML/JSON text/UTF-8 bytes atomically. Tabular formats replace the workbook with one worksheet.
saveSaves a snapshot with reusable format-specific options; PDF is save-only.
saveTextSaves CSV, XML or JSON text with flat settings. Omits a generated CSV BOM; UTF-8 byte limits/events still include it. Does not change the workbook or options.

Examples

Load the package stylesheet and copy the package fonts to /assets/sheet/fonts/ as described in Getting Started. Pass an empty host element. Retain the returned editor and destroy it when the host is removed.

import { Spreadsheet } from '@txtextcontrol/tx-sheet-control';

function createInvoiceEditor(host: HTMLElement) {
    const editor = new Spreadsheet(host, { license: 'YOUR_SIGNED_LICENSE', fontCatalogURL: '/assets/sheet/fonts/catalog.json', height: 600 });
    const sheet = editor.workbook.sheets.at(0);
    sheet.range('A1:B3').setValues([
        ['Item', 'Amount'],
        ['Consulting', 120],
        ['Training', 80],
    ]);

    sheet.cell('B4').setFormula('=SUM(B2:B3)');
    return editor;
}

See Also

Replace YOUR_SIGNED_LICENSE with your issued Trial, Developer or OEM token before running the editor example.