@@ -58,6 +58,8 @@ type PivotTableOptions struct {
5858 ShowRowStripes bool
5959 ShowColStripes bool
6060 ShowLastColumn bool
61+ FieldPrintTitles bool
62+ ItemPrintTitles bool
6163 PivotTableStyleName string
6264}
6365
@@ -90,6 +92,8 @@ type PivotTableField struct {
9092 Data string
9193 Name string
9294 Outline bool
95+ ShowAll bool
96+ InsertBlankRow bool
9397 Subtotal string
9498 DefaultSubtotal bool
9599 NumFmt int
@@ -349,6 +353,8 @@ func (f *File) addPivotTable(cacheID, pivotTableID int, opts *PivotTableOptions)
349353 CreatedVersion : pivotTableVersion ,
350354 CompactData : & opts .CompactData ,
351355 ShowError : & opts .ShowError ,
356+ FieldPrintTitles : opts .FieldPrintTitles ,
357+ ItemPrintTitles : opts .ItemPrintTitles ,
352358 DataCaption : "Values" ,
353359 Location : & xlsxLocation {
354360 Ref : topLeftCell + ":" + bottomRightCell ,
@@ -555,6 +561,8 @@ func (f *File) addPivotFields(pt *xlsxPivotTableDefinition, opts *PivotTableOpti
555561 DataField : inPivotTableField (opts .Data , name ) != - 1 ,
556562 Compact : & rowOptions .Compact ,
557563 Outline : & rowOptions .Outline ,
564+ ShowAll : rowOptions .ShowAll ,
565+ InsertBlankRow : rowOptions .InsertBlankRow ,
558566 DefaultSubtotal : & rowOptions .DefaultSubtotal ,
559567 Items : & xlsxItems {
560568 Count : len (items ),
@@ -591,6 +599,8 @@ func (f *File) addPivotFields(pt *xlsxPivotTableDefinition, opts *PivotTableOpti
591599 DataField : inPivotTableField (opts .Data , name ) != - 1 ,
592600 Compact : & columnOptions .Compact ,
593601 Outline : & columnOptions .Outline ,
602+ ShowAll : columnOptions .ShowAll ,
603+ InsertBlankRow : columnOptions .InsertBlankRow ,
594604 DefaultSubtotal : & columnOptions .DefaultSubtotal ,
595605 Items : & xlsxItems {
596606 Count : len (items ),
@@ -831,12 +841,14 @@ func (f *File) getPivotTable(sheet, pivotTableXML, pivotCacheRels string) (Pivot
831841 return opts , err
832842 }
833843 opts = PivotTableOptions {
834- pivotTableXML : pivotTableXML ,
835- pivotCacheXML : pivotCacheXML ,
836- pivotSheetName : sheet ,
837- DataRange : fmt .Sprintf ("%s!%s" , pc .CacheSource .WorksheetSource .Sheet , pc .CacheSource .WorksheetSource .Ref ),
838- PivotTableRange : fmt .Sprintf ("%s!%s" , sheet , pt .Location .Ref ),
839- Name : pt .Name ,
844+ pivotTableXML : pivotTableXML ,
845+ pivotCacheXML : pivotCacheXML ,
846+ pivotSheetName : sheet ,
847+ DataRange : fmt .Sprintf ("%s!%s" , pc .CacheSource .WorksheetSource .Sheet , pc .CacheSource .WorksheetSource .Ref ),
848+ PivotTableRange : fmt .Sprintf ("%s!%s" , sheet , pt .Location .Ref ),
849+ Name : pt .Name ,
850+ FieldPrintTitles : pt .FieldPrintTitles ,
851+ ItemPrintTitles : pt .ItemPrintTitles ,
840852 }
841853 if pc .CacheSource .WorksheetSource .Name != "" {
842854 opts .DataRange = pc .CacheSource .WorksheetSource .Name
@@ -924,7 +936,9 @@ func (f *File) extractPivotTableFields(order []string, pt *xlsxPivotTableDefinit
924936// settings by given pivot table fields.
925937func extractPivotTableField (data string , fld * xlsxPivotField ) PivotTableField {
926938 pivotTableField := PivotTableField {
927- Data : data ,
939+ Data : data ,
940+ ShowAll : fld .ShowAll ,
941+ InsertBlankRow : fld .InsertBlankRow ,
928942 }
929943 fields := []string {"Compact" , "Name" , "Outline" , "Subtotal" , "DefaultSubtotal" }
930944 immutable , mutable := reflect .ValueOf (* fld ), reflect .ValueOf (& pivotTableField ).Elem ()
0 commit comments