diff --git a/ClosedXML/Excel/XLWorkbook_Load.cs b/ClosedXML/Excel/XLWorkbook_Load.cs index 75f9cee..f390711 100644 --- a/ClosedXML/Excel/XLWorkbook_Load.cs +++ b/ClosedXML/Excel/XLWorkbook_Load.cs @@ -554,6 +554,28 @@ if (pivotField != null) { + if (pf.AverageSubTotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.Average); + else if (pf.CountASubtotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.Count); + else if (pf.CountSubtotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.CountNumbers); + else if (pf.MaxSubtotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.Maximum); + else if (pf.MinSubtotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.Minimum); + else if (pf.ApplyStandardDeviationPInSubtotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.PopulationStandardDeviation); + else if (pf.ApplyVariancePInSubtotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.PopulationVariance); + else if (pf.ApplyProductInSubtotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.Product); + else if (pf.ApplyStandardDeviationInSubtotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.StandardDeviation); + else if (pf.SumSubtotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.Sum); + else if (pf.ApplyVarianceInSubtotal != null) + pivotField.AddSubtotal(XLSubtotalFunction.Variance); var items = pf.Items.OfType().Where(i => i.Index != null && i.Index.HasValue); if (!items.Any(i => i.HideDetails == null || BooleanValue.ToBoolean(i.HideDetails))) pivotField.SetCollapsed();