简体   繁体   English

EPPLUS Pivot 表格布局中的表格标题不起作用

[英]EPPLUS Pivot Table headers in tabular layout doesn't work

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.我已经根据此解决方案设置了表格布局,但标题 pivot 表上的过滤器仍然采用紧凑布局,在第一个 header 中具有所有过滤器的唯一“行标签”。

Microsoft Compact/Tabular Layout Microsoft 紧凑/表格布局Microsoft 紧凑/表格布局

这是我的结果

This is the expected result这是预期的结果

I think this is a bug of EPPLUS, does anyone have any solution?我认为这是EPPLUS的一个bug,有没有人有解决办法?

I use version 6.1.1.0 of EPPLUS我用的EPPLUS 6.1.1.0版本

This is the configuration of my pivot table:这是我的 pivot 表的配置:

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:这是我在 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();

Found solution, set Outline and Compact to false for each fields of pivot table.找到解决方案,将 pivot 表的每个字段的 Outline 和 Compact 设置为 false。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM