@@ -223,6 +223,28 @@ public enum PictureInsertType : byte
223223 PictureInsertTypeDISPIMG = 3 ,
224224 }
225225
226+ /// <summary>
227+ /// PivotTableShowValuesAsType defines the calculation type enumeration.
228+ /// </summary>
229+ public enum PivotTableShowValuesAsType : byte
230+ {
231+ PivotTableShowValuesAsNoCalculation = 0 ,
232+ PivotTableShowValuesAsPercentOfGrandTotal = 1 ,
233+ PivotTableShowValuesAsPercentOfColumnTotal = 2 ,
234+ PivotTableShowValuesAsPercentOfRowTotal = 3 ,
235+ PivotTableShowValuesAsPercentOf = 4 ,
236+ PivotTableShowValuesAsPercentOfParentRowTotal = 5 ,
237+ PivotTableShowValuesAsPercentOfParentColumnTotal = 6 ,
238+ PivotTableShowValuesAsPercentOfParentTotal = 7 ,
239+ PivotTableShowValuesAsDifferenceFrom = 8 ,
240+ PivotTableShowValuesAsPercentDifferenceFrom = 9 ,
241+ PivotTableShowValuesAsRunningTotalIn = 10 ,
242+ PivotTableShowValuesAsPercentRunningTotalIn = 11 ,
243+ PivotTableShowValuesAsRankSmallestToLargest = 12 ,
244+ PivotTableShowValuesAsRankLargestToSmallest = 13 ,
245+ PivotTableShowValuesAsIndex = 14 ,
246+ }
247+
226248 /// <summary>
227249 /// Interface is a struct that can be used to represent any of the supported
228250 /// value types in the library, including int, string, double, bool,
@@ -769,6 +791,7 @@ public struct PivotTableField
769791 public bool DefaultSubtotal ;
770792 public int NumFmt ;
771793 public string [ ] ? SelectedItems ;
794+ public PivotTableShowValuesAs ShowValuesAs ;
772795 }
773796
774797 /// <summary>
@@ -875,6 +898,17 @@ public struct SheetProtectionOptions
875898 public bool Sort ;
876899 }
877900
901+ /// <summary>
902+ /// PivotTableShowValuesAs directly maps the show value as settings of the
903+ /// pivot table.
904+ /// </summary>
905+ public struct PivotTableShowValuesAs
906+ {
907+ public PivotTableShowValuesAsType Type ;
908+ public string BaseField ;
909+ public string BaseItem ;
910+ }
911+
878912 /// <summary>
879913 /// Represents the settings of the slicer.
880914 /// </summary>
@@ -911,6 +945,46 @@ public struct SheetProtectionOptions
911945 /// <c>AddPivotTable</c> function, the same field must also have its
912946 /// selected item range specified at the time the pivot table is created.
913947 /// </para>
948+ /// <para><b>ShowValuesAs</b> specifies the calculation type for showing
949+ /// values in a pivot table values fields. The possible values for the
950+ /// <c>Type</c> field of <c>ShowValuesAs</c> are:
951+ /// <list type="bullet">
952+ /// <item><description><c>PivotTableShowValuesAsNoCalculation</c></description></item>
953+ /// <item><description><c>PivotTableShowValuesAsPercentOfGrandTotal</c></description></item>
954+ /// <item><description><c>PivotTableShowValuesAsPercentOfColumnTotal</c></description></item>
955+ /// <item><description><c>PivotTableShowValuesAsPercentOfRowTotal</c></description></item>
956+ /// <item><description><c>PivotTableShowValuesAsPercentOf</c></description></item>
957+ /// <item><description><c>PivotTableShowValuesAsPercentOfParentRowTotal</c></description></item>
958+ /// <item><description><c>PivotTableShowValuesAsPercentOfParentColumnTotal</c></description></item>
959+ /// <item><description><c>PivotTableShowValuesAsPercentOfParentTotal</c></description></item>
960+ /// <item><description><c>PivotTableShowValuesAsDifferenceFrom</c></description></item>
961+ /// <item><description><c>PivotTableShowValuesAsPercentDifferenceFrom</c></description></item>
962+ /// <item><description><c>PivotTableShowValuesAsRunningTotalIn</c></description></item>
963+ /// <item><description><c>PivotTableShowValuesAsPercentRunningTotalIn</c></description></item>
964+ /// <item><description><c>PivotTableShowValuesAsRankSmallestToLargest</c></description></item>
965+ /// <item><description><c>PivotTableShowValuesAsRankLargestToSmallest</c></description></item>
966+ /// <item><description><c>PivotTableShowValuesAsIndex</c></description></item>
967+ /// </list>
968+ /// Note that the base field and base item settings of <c>ShowValuesAs</c>
969+ /// are only required for some calculation types, the calculation types
970+ /// requires base field settings are:
971+ /// <list type="bullet">
972+ /// <item><description><c>PivotTableShowValuesAsPercentOf</c></description></item>
973+ /// <item><description><c>PivotTableShowValuesAsPercentOfParentTotal</c></description></item>
974+ /// <item><description><c>PivotTableShowValuesAsDifferenceFrom</c></description></item>
975+ /// <item><description><c>PivotTableShowValuesAsPercentDifferenceFrom</c></description></item>
976+ /// <item><description><c>PivotTableShowValuesAsRunningTotalIn</c></description></item>
977+ /// <item><description><c>PivotTableShowValuesAsPercentRunningTotalIn</c></description></item>
978+ /// <item><description><c>PivotTableShowValuesAsRankSmallestToLargest</c></description></item>
979+ /// <item><description><c>PivotTableShowValuesAsRankLargestToSmallest</c></description></item>
980+ /// </list>
981+ /// The supported calculation types requires base item settings are:
982+ /// <list type="bullet">
983+ /// <item><description><c>PivotTableShowValuesAsPercentOf</c></description></item>
984+ /// <item><description><c>PivotTableShowValuesAsDifferenceFrom</c></description></item>
985+ /// <item><description><c>PivotTableShowValuesAsPercentDifferenceFrom</c></description></item>
986+ /// </list>
987+ /// </para>
914988 /// </remarks>
915989 public struct SlicerOptions
916990 {
0 commit comments