4D View Pro: What’s new in 4D 21 R2

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.

Documentation | Demo

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. 

Documentation | Demo

Filter Dialog Keyboard Operations Support

The filtering dialog in PivotTables now supports full keyboard navigation: Tab, Shift + Tab, arrow keys, Space, Enter, and Esc. 

Documentation | Demo

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. 

Documentation

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. 

Documentation

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.

Documentation

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.

Documentation

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.

Documentation

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:

Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.