How to set Pivot table Report Layout to tabular in EPPlus?

后端 未结 2 1530
误落风尘
误落风尘 2021-01-12 15:39

Looking at the samples that come with EPPlus I have managed to create the pivot table, but I am unable to set the correct report layout for it. I want it to be \'tabular\',

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-12 16:15

    This turned out to be way easier than I thought... By setting 'everything' to 'false' it the table rendered as Tabular. So basically:

    pivotTable.Compact = false;
    pivotTable.CompactData = false;
    pivotTable.Indent = 0;
    pivotTable.RowGrandTotals = false;
    pivotTable.UseAutoFormatting = true;
    pivotTable.ShowMemberPropertyTips = false;
    pivotTable.DataOnRows = false;
    
    field.Outline = false;
    field.Compact = false;
    field.ShowAll = false;
    field.SubtotalTop = false;
    

    That way I get the pivot table with tabular layout.

提交回复
热议问题