TX Sheet Control

ServerSheetControl Class

Class

An isolated workbook, shared document API and file filters, without an editor or DOM.

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

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

Constructor

new ServerSheetControl(options?: ServerSheetControlOptions): ServerSheetControl
ParameterTypeOptionalDescription
optionsServerSheetControlOptions | undefinedYesSupported settings for this operation; omitted settings retain documented defaults.

Returns: ServerSheetControl.

Members

Properties

PropertyDescription
licenseInfoImmutable signed metadata; readable even after trial expiry or disposal.
optionsThe options value of ServerSheetControl.
userNameCurrent runtime comment author, shared with this control's workbook.
workbookThe workbook value of ServerSheetControl.

Methods

MethodDescription
batchApply serializable compatibility commands atomically.
destroyDispose this isolated document.
getFontCatalogDiscovers the deployed families used by the editor and PDF export. Each call checks for file changes.
getFontFileReads a catalogued font for HTTP hosting without exposing trusted server paths.
getPdfInfoMetadata for the last completed PDF export.
getPrintLayoutRead font-measured print geometry asynchronously.
getWarningsRead merge/export warning strings.
getXlsxWarningsRead retained XLSX feature notices.
invokeWorkbookInvoke an allowlisted document operation by name.
loadLoads workbook bytes or CSV/XML/JSON text/bytes as an atomic document replacement. Native workbook JSON is not a tabular interchange format.
mergeApply configured bindings to this document.
refreshFontsRe-reads deployed fonts even if their filesystem timestamps were preserved.
saveSaves an isolated revision as .xlsx, .txwb, PDF, CSV, tabular XML or tabular JSON without changing workbook metadata.
saveTextSaves CSV, XML or JSON text with the same settings, snapshot, events and UTF-8 byte limits as save. A generated CSV BOM is omitted from the string; supplied settings are not modified.
setPrintContextSet shared header/footer field context.

Examples

Return a PDF byte array from an isolated server control. Configure a signed license before creating the server; Developer and OEM server exports have no licensing branding.

import { ServerSheetControl, StreamType } from '@txtextcontrol/tx-sheet-control-server';

async function createInvoicePdf() {
    const control = new ServerSheetControl();

    try {
        const sheet = control.workbook.sheets.at(0);
        sheet.range('B8:B9').setValues([[120], [80]]);
        sheet.cell('B10').setFormula('=SUM(B8:B9)');
        return await control.save(StreamType.PDF);
    } finally {
        control.destroy();
    }
}

See Also