EPPLUS Pivot Table headers in tabular layout doesn't work

115 Views Asked by At

I have set the tabular layout according to this solution, but the filters on headers pivot table remains in Compact layout with unique "Row Label" in the first header with all filters.

Microsoft Compact/Tabular Layout Microsoft Compact/Tabular Layout

This is my result

This is the expected result

I think this is a bug of EPPLUS, does anyone have any solution?

I use version 6.1.1.0 of EPPLUS

This is the configuration of my pivot table :

pivotTable.ColumnGrandTotals = true;
pivotTable.Compact = false;
pivotTable.CompactData = false;
pivotTable.DataCaption = "Values";
pivotTable.DataOnRows = false;
pivotTable.ErrorCaption = "[error]";
pivotTable.GridDropZones = true;
pivotTable.Outline = false;
pivotTable.OutlineData = false;
pivotTable.RowGrandTotals = true;
pivotTable.ShowColumnHeaders = true;
pivotTable.ShowError = true;
pivotTable.ShowHeaders = true;
pivotTable.ShowMemberPropertyTips = false;
pivotTable.ShowValuesRow = false;

This is the how I add the fields in RowFields :

var field = pivotTable.Fields[fieldName];
field.Outline = false;
field.Compact = false;
field.SubTotalFunctions = eSubTotalFunctions.None;
field = pivotTable.RowFields.Add(field);
field.ShowDropDowns = true;
field.Items.Refresh();
1

There are 1 best solutions below

0
On

Found solution , set Outline and Compact to false for each fields of pivot table.

pivotTable.Fields.ForEach(field => { field.Outline = false; field.Compact = false; });