In the Wijmo 2019 v1 release, Wijmo introduces a new layout for the OLAP PivotGrid control. Outline Layouts are common in Excel Pivot Tables, and the OLAP PivotGrid has adopted a similar feature to provide alternate views.
By default, the PivotGrid's layout merges Row Header cells. This creates large cells with little text.
Using an Outline layout will help reduce the extra white space and display the data in a nested group structure. More columns are viewable within the same area, and the white space is minimal.
This new layout is exposed from the PivotGrid's outlineMode property. Set this property to true to enable the layout view.
If you are an Excel guru, you may notice that when outline mode is enabled the PivotGrid's layout closely resembles the "Compact" layout option in Excel due to the indentions and single column header cell.
However, this is not the case with PivotGrid. Each Row field is in a separate column. The main column header is merged to appear as one (the top-left cell).
Configure to Excel-like Layout
When the outlineMode property is set to true, you may notice that the PivotGrid layout does not mimic Excel's layout exactly.
The Row headers are at the bottom of the group, and subtotals are also. There are a couple of configurations you should add if you want to make the display resemble Excel.
- Update the PivotEngine to show totals before the data.
PivotEngine.totalsBeforeData = 'Subtotals';
- (Optional) Show row headers.
PivotGrid.showRowFieldHeaders = true;
When both of these properties are configured, the PivotGrid may look like this:
Notice how the Country is now positioned above the group of Products and Colors. Excel does this by default.
Also, the row header labels are combined into a single cell. The names and order indicate the hierarchy and names of the row headers.
There is one main distinction between the PivotGrid's outlineMode feature and Excel's outline layout behavior. In PivotGrid, the Row Headers row may be positioned above or below the nested content. (refer to image 3 & 4). In Excel, the Row headers is always positioned above the grouped rows, even if subtotals are enabled display below the grouped rows. Excel will add an additional row for each group.
The new outlineMode feature gives you a nice compressed layout that maximizes the screen realty for viewing aggregate data. Using some of PivotGrid's properties, you can create layouts that mimic Tabular, Compact and Outline Layouts from Excel Pivot Tables.
Check out the new "Outline Mode" sample here.