Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Wiki Markup
{introducedin: 8.4

...

Description

Excerpt

Sets or returns the type of calculation used to summarize a data field. The available types are determined by PivotTableField.SummarizeByType.

{signature}
{example}{code:csharp|title=C#}

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Open(@"C:\MySpreadsheet.xlsx");
          Worksheet ws = wb.Worksheets[0];
          DataField df = ws.PivotTables[0].DataFields[0];
          df.SummarizeBy = PivotTableField.SummarizeByType.Average;
        
{code}
{code:vbnet|title=vb.net
}

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Open("C:\MySpreadsheet.xlsx")
          Dim ws As Worksheet = wb.Worksheets(0)
          Dim df As DataField = ws.PivotTables(0).DataFields(0)
          df.SummarizeBy = PivotTableField.SummarizebyType.Average
        
Signature
C#C#
}
{description}

{excerpt}Sets or returns the type of calculation used to summarize a data field. The available types are determined by {{[PivotTableField.SummarizeByType]}}.{excerpt}
{signature:C#}
 public SummarizeByType SummarizeBy{ get; set; }
Signature
{signature}{signature:vb.net
vb.net
}
Public Property SummarizeBy() As SummarizeByType
Example
Code Block
csharpcsharp
titleC#
Code Block
vbnetvbnettitle
Remarks
Data fields are set to
{code}

{example}
{remarks}
Data fields are set to 'SUM' by default for all data types.
 

This property cannot be set on values labels and such fields will return {{SummarizeByType.Sum}} by default. You can check if a PivotTable field is values label with the {{[IsValuesLabel |EW8:PivotTableField.IsValuesLabel]}} property
{remarks}