4D 21 R2 introduces an updated version of 4D View Pro based on SpreadJS v18.2, along with a Ribbon fully compatible with this release. Since 4D View Pro is built on top of SpreadJS, upgrading the underlying engine immediately brings performance improvements and new capabilities. Some of these enhancements are directly available in 4D, others can be accessed through the View Pro designer, and a few require custom JavaScript code. In this article, we highlight the most important changes introduced by SpreadJS v18.2, including features that are not yet directly exposed as 4D functions.
PivotTable Add-On Enhancements
Support to Change Data Source
Previously, once a PivotTable was bound to a data set, changing that source required a lot of manual work. Now, with the updateSource method (and Designer UI support), you can seamlessly switch the data behind a PivotTable and keep the existing layout intact.
Show Subtotal in Single Field
You can now show subtotals for individual fields, just like Excel. Using pivotTable.subtotalVisible(“FieldName”, true), you control whether subtotals appear.

Filter Dialog Keyboard Operations Support
The filtering dialog in PivotTables now supports full keyboard navigation: Tab, Shift + Tab, arrow keys, Space, Enter, and Esc.
Performance Improvements
The v18.1 release brings big performance gains: internal benchmarks show 30–50% faster rendering and interaction, plus over 50% memory reduction for PivotTables.
Field Formatting Enhancements (Excel-like PivotTable)
There is now more granular formatting control (number formats, fonts, and colors) directly on PivotTable fields.
PivotTable Full Column Data Source
This feature allows you to bind a PivotTable source to full worksheet columns, e.g., Sheet1!C:D, instead of a fixed range.
Enhanced Calculation Engine
TRIMRANGE Function
A new function to trim empty rows or columns at the edges of a data range. You can choose to trim leading, trailing, or both sides.
REGEX Functions
Three Excel-compatible regex functions:
- REGEXTEST(text, pattern): check whether a string matches a pattern.
- REGEXEXTRACT(text, pattern): extract substring(s) that match.
- REGEXREPLACE(text, pattern, replacement): replace matches with something else.
GROUPBY, PIVOTBY, PERCENTOF
These aggregation functions let you do advanced summary operations:
- GROUPBY: Create a summary of data by grouping along row fields and aggregating the associated values.
Demo - PIVOTBY: Create a summary of data by grouping along two axes and aggregating the associated values.
Demo - PERCENTOF: Sums the first argument and divides it by the SUM of the second argument. This is particularly useful with GROUPBY and PIVOTBY, as it can return percentages.
Demo
Import / Export Improvements
Lossless XML Map Export
You can now export XML maps without losing fidelity, preserving macros and XML Maps.
XLSM and XLTM File Format Support
4D View Pro now supports macro-enabled Excel workbooks (.xlsm) and templates (.xltm). While macros themselves may not be executed, their definitions are preserved on import/export.
Conclusion
These enhancements represent only a portion of what SpreadJS v18, v18.1, and v18.2 offer. If you want to explore all the new features and improvements, you can find the full details on the three official release pages:
