EPPlus Pivot Table - Collapse entire field

前端 未结 2 1996
灰色年华
灰色年华 2021-01-13 00:16

Does anyone know how to do this?

I\'m using EPPlus in .Net and have created a pivot table with 2 row fields and one summary datafield:

Dim Pivot As O         


        
2条回答
  •  长发绾君心
    2021-01-13 00:48

    Using EPPlus you could try something like (Taken from this SO post):

    (from pf in pivot.Fields
     select pf).ToList().ForEach(f =>
     {
         f.Compact = false;
         f.Outline = false;
     });
    

    or perhaps more simply, doesn't something like the following work?

    pvtTable.Compact = False
    pvtTable.CompactData = False
    pvtTable.Outline = False
    pvtTable.OutlineData = False
    pvtTable.ShowDrill = True
    

    Also look at this SO post detailing a nice reverse engineer method for seeing how excel achieves 'things'.

    P.S. Can't help you with your other 'also' question sorry.

提交回复
热议问题