Workbook Class
Licensed workbook model. Active-sheet methods use the selected worksheet; retained handles bind explicit sheets.
Package: @txtextcontrol/tx-sheet-control/angular. Version: 2.0.0.
ES module import: import { Workbook } from '@txtextcontrol/tx-sheet-control';.
Constructor
new Workbook(options?: WorkbookOptions): WorkbookInstance
| Parameter | Type | Optional | Description |
|---|---|---|---|
options | WorkbookOptions | undefined | Yes | Supported settings for this operation; omitted settings retain documented defaults. |
Returns: WorkbookInstance.
Members
Properties
| Property | Description |
|---|---|
| activeSheetId | The activeSheetId value of Workbook. |
| activeSheetName | The activeSheetName value of Workbook. |
| activeView | The sole sheet or dashboard view displayed by the integrated editor. |
| analytics | Workbook-wide deterministic data profiling, relationships and asynchronous queries. |
| autoExpand | The autoExpand value of Workbook. |
| calculation | The calculation value of Workbook. |
| cellTypes | The cellTypes value of Workbook. |
| columns | The columns value of Workbook. |
| dashboards | Independent first-class dashboard definitions, persisted by .txwb and .ods. |
| dateSystem | The dateSystem value of Workbook. |
| events | The events value of Workbook. |
| history | The history value of Workbook. |
| maxColumns | The maxColumns value of Workbook. |
| maxRows | The maxRows value of Workbook. |
| names | The names value of Workbook. |
| rows | The rows value of Workbook. |
| search | The search value of Workbook. |
| sheets | The sheets value of Workbook. |
| userName | The userName value of Workbook. |
Methods
| Method | Description |
|---|---|
| addConditionalRule | Adds a validated active-sheet rule; returns its stable ID (maximum 200 rules). |
| addSparklines | Active-sheet sparkline operation; validated, persisted and undoable. |
| applyCellStyle | Applies a named style to the active-sheet range in one undo operation. |
| batch | The batch operation of Workbook. |
| clearFilters | Removes filter criteria while keeping the filter range. |
| clearSparklines | Active-sheet sparkline operation; validated, persisted and undoable. |
| consolidate | Consolidates same-sheet ranges in one undo operation. |
| createCellStyle | Creates a workbook-wide style; returns its stable ID. |
| createMailMergeTemplate | The createMailMergeTemplate operation of Workbook. |
| deleteConditionalRule | Removes the active-sheet conditional rule in one undo operation. |
| ensureSize | The ensureSize operation of Workbook. |
| getAutoFilter | Returns the active-sheet filter as a detached snapshot. |
| getMailMerge | The getMailMerge operation of Workbook. |
| getSparklineGroups | Active-sheet sparkline operation; validated, persisted and undoable. |
| listConditionalRules | Lists detached active-sheet conditional rules, optionally intersecting a range. |
| listNamedStyles | Lists detached workbook-wide named style definitions. |
| load | Loads XLSX/TXWB bytes or CSV/XML/JSON text/UTF-8 bytes atomically. Tabular formats replace the workbook with one worksheet. |
| merge | The merge operation of Workbook. |
| onChange | The onChange operation of Workbook. |
| previewConsolidate | Previews a bounded consolidation without modifying the destination. |
| previewRemoveDuplicates | Previews retained/removed rows without changing data or history. |
| previewTextToColumns | Previews splitting a single source column without writing cells. |
| recalculate | The recalculate operation of Workbook. |
| removeDuplicates | Removes duplicates in the selected range in one undo operation. |
| save | Saves a snapshot with reusable format-specific options; PDF is save-only. |
| saveText | Saves 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. |
| setAutoFilter | Sets/removes the active-sheet filter; criteria are native validated filter definitions. |
| setFormulaProvider | The setFormulaProvider operation of Workbook. |
| setMailMerge | The setMailMerge operation of Workbook. |
| setTheme | Changes the workbook's twelve native theme colors in one undo operation. |
| sortRange | Sorts the active sheet in one undoable operation; rejects merged ranges and invalid keys. |
| textToColumns | Applies the split in one undo operation; rejects occupied targets unless overwrite is true. |
| updateCellStyle | Updates a named style; affected cells on every sheet inherit the update. |
| updateConditionalRule | Updates the active-sheet rule with the given ID; rejects unknown IDs. |
| updateSparklineGroup | Active-sheet sparkline operation; validated, persisted and undoable. |
Examples
Use a fresh sample workbook for this example. In the browser pass editor.workbook; in Node.js pass the server control. Document-bound objects are obtained from that same owner.
import type { Workbook } from '@txtextcontrol/tx-sheet-control/angular';
function calculateInvoiceTotal(book: Workbook) {
const sheet = book.sheets.at(0);
sheet.range('B8:B9').setValues([[120], [80]]);
sheet.cell('B10').setFormula('=SUM(B8:B9)');
console.log(sheet.cell('B10').value); // 200
}
See Also
Additional and Inherited Members
| Member | Ownership |
|---|---|
| pivotTables | Shared workbook pivot operations. |