Document Processing
Document processing turns files into workbooks and workbooks into files. TX Sheet Control reads XLSX, ODS and TXWB, updates cells and formulas, merges JSON into templates and saves XLSX, ODS, TXWB or PDF. One worksheet can also be exchanged as UTF-8 CSV, tabular XML or JSON records and rows.
You do this in the browser editor or on a server, where the .NET and Node.js server packages operate independently of the browser editor. Find out how loading and saving works and what an exchange with Excel keeps. For a backend service, see how to run, scale and measure processing.
How It Works
- One dispatcher for every format.
loadandsave, and in .NETLoadAsync,LoadTextAsync,SaveAsyncandSaveTextAsync, take a stream type that selects the format:SpreadsheetMLfor XLSX,InternalWorkbookFormatfor TXWB,PDF,CSV,XMLandJSON. A filename extension alone does not select the format. - Workbooks or values. XLSX exchanges spreadsheet documents with Excel-compatible applications. TXWB retains TX Sheet Control views, dashboards and report metadata. PDF delivers fixed-page output that cannot be loaded again. CSV, XML and JSON transfer the values of one worksheet, not workbook features.
- Owners and handles. Each mutable document has an owner: the browser editor or a backend control. Loading replaces the document and invalidates old handles, so you reacquire sheets and ranges after a load.
- Browser or server. The browser editor loads and saves in the browser, without a server round trip for tabular data. The .NET package
TXTextControl.TXSheetControl.Serverand the Node.js package@txtextcontrol/tx-sheet-control-servercreate reports without a browser.
Choose Where Documents Are Processed
Editing and exporting in the editor happen in the browser, in the application page. Backend processing belongs to a .NET or Node.js service or console application. Use a backend when documents must be:
- Generated on a schedule
- Processed without a browser
- Combined with data that must remain on the server
Give unrelated users and jobs separate document instances or deliberately managed sessions. Authentication, authorization, storage, request limits and application data retrieval belong to the host application.
Design a Predictable Pipeline
- Load a trusted template or validate an uploaded file.
- Resolve the worksheet and the ranges to update.
- Apply values, formulas, formatting or mail merge.
- Check the warnings and the business totals.
- Export the required format and deliver the bytes.
- Release the control or document when finished.
Three rules apply to the pipeline:
- Editor initialization. Await the initialization of the editor before font-sensitive work.
- Backend tasks and promises. Await every backend task or promise before you use its result or dispose its owner.
- Handles. Loading replaces document identities, so reacquire your handles after a load.
Find the Right Page
| If you want to | Read |
|---|---|
| Load and save XLSX, ODS, TXWB and PDF, get text output and deliver the bytes | Loading and Saving Workbooks |
| Import and export one worksheet as CSV, XML or JSON, with delimiters, schemas and limits | CSV, XML and JSON Data |
| Validate what an XLSX exchange keeps and choose between XLSX, ODS, TXWB and PDF | XLSX Compatibility |
| Set the title, author and other metadata of exported documents | Document Properties |
| Supply fonts with a document or embed the used fonts in the saved file | Fonts in Documents |
| Create reports in a .NET or Node.js backend and return them as an HTTP response | Backend Services |
| Create and dispose controls, bound parallel requests and group changes in batches | Lifetime and Concurrency |
| Benchmark loading and export and calculate throughput | Measuring Performance |
| Merge JSON records into a workbook template | Mail Merge |
| Prepare print settings and export worksheets to PDF | PDF Export |
Where to Start
- Loading and Saving Workbooks: the formats, the stream types and the handling of failures.
- XLSX Compatibility: validate a representative document before you rely on a conversion.
- Backend Services and Lifetime and Concurrency, when you process workbooks on a server.
If you haven't processed a workbook on a server yet, build a first job with .NET or Node.js in Getting Started.
Pages in This Section
Loading and Saving Workbooks: the seven formats and their stream types, loading and saving, string output, delivering the bytes, options and failures.
CSV, XML and JSON Data: tabular import and export in JavaScript, TypeScript, ASP.NET Core, Angular, Node.js and .NET, with conventions and limits.
XLSX Compatibility: conversion warnings, a representative test document, round trips and the choice of format.
Document Properties: the metadata of exported documents, inherited template metadata and the differences between formats.
Backend Services: the request flow, HTTP responses, pooling, application data and deployment checks.
Lifetime and Concurrency: owners of documents, disposal, sessions, bounded concurrency, batches and recovery from errors.
Measuring Performance: scenarios, measurements, throughput, warmup, the .NET benchmark sample and the interpretation of results.
OpenDocument Spreadsheet: load, edit and save ODS with original-package preservation.
Fonts in Documents: fonts supplied with a document, font substitutions and embedded fonts in saved files.