PDF reports and XLSX editing
Export a grid report as PDF
Section titled “Export a grid report as PDF”Download the sample grid as a two-page PDF with a header on each page.
Register ExportGridPdfPlugin on a regular grid. The report uses the grid’s visible columns and loaded rows in their current order, including pinned rows. Scrolling does not change the report. Loading, skeleton and error rows are skipped.
import { ExportGridPdfPlugin } from '@revolist/revogrid-pro';
grid.plugins = [ExportGridPdfPlugin];await grid.componentOnReady();const plugin = (await grid.getPlugins()).find( (candidate) => candidate instanceof ExportGridPdfPlugin,);await plugin?.exportFile({ filename: 'orders-report', title: 'Orders', columns: ['orderId', 'status', 'total'], paper: 'A4', orientation: 'landscape', rowsPerPage: 24,});Each page repeats the column headers. rowsPerPage forces a break after the requested number of rows if the content has not already used the available space. Supply formatValue to format raw values or apply your application’s translations. The report uses selectable text with pdfmake’s Roboto fonts. Use getDocumentDefinition() to supply your own layout or fonts, and exportBlob() to deliver bytes through your application.
For remote pagination, grouping and infinite scrolling, pass scope: 'loaded' to acknowledge that the report covers only the loaded rows visible under the current grid state. For a complete remote dataset, use an application-owned server report. Client exports are capped at 100,000 cells.
Edit an XLSX workbook
Section titled “Edit an XLSX workbook”Open the sample workbook, edit a cell, and switch to Stock. Use Save XLSX to download the edited file.
Use a dedicated local grid and supply your application’s ExcelJS module to WorkbookEditingPlugin. The plugin adds a worksheet selector using the shared segmented control. Supply tabsHost to choose its location and sheetsLabel for the localized accessible name.
import ExcelJS from 'exceljs';import { WorkbookEditingPlugin } from '@revolist/revogrid-pro';
grid.plugins = [WorkbookEditingPlugin];await grid.componentOnReady();const workbook = (await grid.getPlugins()).find( (candidate) => candidate instanceof WorkbookEditingPlugin,);
// Call from your file input or drop handler.await workbook?.open(file, { exceljs: ExcelJS, sheetsLabel: 'Worksheets' });
// Call after committing the active cell editor.await workbook?.exportFile('orders-updated.xlsx');The editor projects the existing sheets into the grid one at a time. Edits to scalar values and formulas persist across sheet switches. The original ExcelJS workbook remains the backing document, so cell number formats, styles and existing merges remain in the saved workbook to the extent supported by ExcelJS. Existing merged follower cells and complex cells such as rich text are read-only. Hidden worksheets stay in the file and remain available to supported cross-sheet formulas.
The editor keeps worksheet coordinates fixed. Commit an active cell editor before switching or saving. ExcelJS handles the file format and determines which advanced Excel features survive serialization. Verify representative files before relying on workbook fidelity. Files are limited to 25 MiB compressed and 200,000 projected cells. close() restores the grid configuration that was present before the workbook opened.