Message-ID: <1342517133.7679.1711618116936.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_7678_1539431541.1711618116936" ------=_Part_7678_1539431541.1711618116936 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Sets or returns the type of calculation used to summarize a data field. =
The available types are determined by PivotTableField.SummarizeByType
.
public SummarizeByType SummarizeBy{ get; set; }=20
Public Property SummarizeBy() As SummarizeByType=20
ExcelApplication xla =3D new ExcelApplication(); Workbook wb =3D xla.Open(@"C:\MySpreadsheet.xlsx"); Worksheet ws =3D wb.Worksheets[0]; DataField df =3D ws.PivotTables[0].DataFields[0]; df.SummarizeBy =3D PivotTableField.SummarizeByType.Average;=20
Dim xla As New ExcelApplication() Dim wb As Workbook =3D xla.Open("C:\MySpreadsheet.xlsx"= ) Dim ws As Worksheet =3D wb.Worksheets(0) Dim df As DataField =3D ws.PivotTables(0).DataFields(0) df.SummarizeBy =3D PivotTableField.SummarizebyType.Average=20
Data fields are set to 'SUM' by default for all data types.
=20This 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
property