@@ -58,6 +58,8 @@ type PivotTableOptions struct {
58
58
ShowRowStripes bool
59
59
ShowColStripes bool
60
60
ShowLastColumn bool
61
+ FieldPrintTitles bool
62
+ ItemPrintTitles bool
61
63
PivotTableStyleName string
62
64
}
63
65
@@ -90,6 +92,8 @@ type PivotTableField struct {
90
92
Data string
91
93
Name string
92
94
Outline bool
95
+ ShowAll bool
96
+ InsertBlankRow bool
93
97
Subtotal string
94
98
DefaultSubtotal bool
95
99
NumFmt int
@@ -349,6 +353,8 @@ func (f *File) addPivotTable(cacheID, pivotTableID int, opts *PivotTableOptions)
349
353
CreatedVersion : pivotTableVersion ,
350
354
CompactData : & opts .CompactData ,
351
355
ShowError : & opts .ShowError ,
356
+ FieldPrintTitles : opts .FieldPrintTitles ,
357
+ ItemPrintTitles : opts .ItemPrintTitles ,
352
358
DataCaption : "Values" ,
353
359
Location : & xlsxLocation {
354
360
Ref : topLeftCell + ":" + bottomRightCell ,
@@ -555,6 +561,8 @@ func (f *File) addPivotFields(pt *xlsxPivotTableDefinition, opts *PivotTableOpti
555
561
DataField : inPivotTableField (opts .Data , name ) != - 1 ,
556
562
Compact : & rowOptions .Compact ,
557
563
Outline : & rowOptions .Outline ,
564
+ ShowAll : rowOptions .ShowAll ,
565
+ InsertBlankRow : rowOptions .InsertBlankRow ,
558
566
DefaultSubtotal : & rowOptions .DefaultSubtotal ,
559
567
Items : & xlsxItems {
560
568
Count : len (items ),
@@ -591,6 +599,8 @@ func (f *File) addPivotFields(pt *xlsxPivotTableDefinition, opts *PivotTableOpti
591
599
DataField : inPivotTableField (opts .Data , name ) != - 1 ,
592
600
Compact : & columnOptions .Compact ,
593
601
Outline : & columnOptions .Outline ,
602
+ ShowAll : columnOptions .ShowAll ,
603
+ InsertBlankRow : columnOptions .InsertBlankRow ,
594
604
DefaultSubtotal : & columnOptions .DefaultSubtotal ,
595
605
Items : & xlsxItems {
596
606
Count : len (items ),
@@ -831,12 +841,14 @@ func (f *File) getPivotTable(sheet, pivotTableXML, pivotCacheRels string) (Pivot
831
841
return opts , err
832
842
}
833
843
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 ,
840
852
}
841
853
if pc .CacheSource .WorksheetSource .Name != "" {
842
854
opts .DataRange = pc .CacheSource .WorksheetSource .Name
@@ -924,7 +936,9 @@ func (f *File) extractPivotTableFields(order []string, pt *xlsxPivotTableDefinit
924
936
// settings by given pivot table fields.
925
937
func extractPivotTableField (data string , fld * xlsxPivotField ) PivotTableField {
926
938
pivotTableField := PivotTableField {
927
- Data : data ,
939
+ Data : data ,
940
+ ShowAll : fld .ShowAll ,
941
+ InsertBlankRow : fld .InsertBlankRow ,
928
942
}
929
943
fields := []string {"Compact" , "Name" , "Outline" , "Subtotal" , "DefaultSubtotal" }
930
944
immutable , mutable := reflect .ValueOf (* fld ), reflect .ValueOf (& pivotTableField ).Elem ()
0 commit comments