Skip to content

Commit b83a36a

Browse files
support ShowError option in Pivot table (qax-os#802)
1 parent 7e12b56 commit b83a36a

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Diff for: pivotTable.go

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ type PivotTableOption struct {
3434
PageOverThenDown bool
3535
MergeItem bool
3636
CompactData bool
37+
ShowError bool
3738
ShowRowHeaders bool
3839
ShowColHeaders bool
3940
ShowRowStripes bool
@@ -308,6 +309,7 @@ func (f *File) addPivotTable(cacheID, pivotTableID int, pivotTableXML string, op
308309
PageOverThenDown: &opt.PageOverThenDown,
309310
MergeItem: &opt.MergeItem,
310311
CompactData: &opt.CompactData,
312+
ShowError: &opt.ShowError,
311313
DataCaption: "Values",
312314
Location: &xlsxLocation{
313315
Ref: hcell + ":" + vcell,

Diff for: pivotTable_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ func TestAddPivotTable(t *testing.T) {
3838
ShowRowHeaders: true,
3939
ShowColHeaders: true,
4040
ShowLastColumn: true,
41+
ShowError: true,
4142
}))
4243
// Use different order of coordinate tests
4344
assert.NoError(t, f.AddPivotTable(&PivotTableOption{

Diff for: xmlPivotTable.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type xlsxPivotTableDefinition struct {
3131
DataCaption string `xml:"dataCaption,attr"`
3232
GrandTotalCaption string `xml:"grandTotalCaption,attr,omitempty"`
3333
ErrorCaption string `xml:"errorCaption,attr,omitempty"`
34-
ShowError bool `xml:"showError,attr,omitempty"`
34+
ShowError *bool `xml:"showError,attr"`
3535
MissingCaption string `xml:"missingCaption,attr,omitempty"`
3636
ShowMissing bool `xml:"showMissing,attr,omitempty"`
3737
PageStyle string `xml:"pageStyle,attr,omitempty"`
@@ -48,7 +48,7 @@ type xlsxPivotTableDefinition struct {
4848
VisualTotals bool `xml:"visualTotals,attr,omitempty"`
4949
ShowMultipleLabel bool `xml:"showMultipleLabel,attr,omitempty"`
5050
ShowDataDropDown bool `xml:"showDataDropDown,attr,omitempty"`
51-
ShowDrill *bool `xml:"showDrill,attr,omitempty"`
51+
ShowDrill *bool `xml:"showDrill,attr"`
5252
PrintDrill bool `xml:"printDrill,attr,omitempty"`
5353
ShowMemberPropertyTips bool `xml:"showMemberPropertyTips,attr,omitempty"`
5454
ShowDataTips bool `xml:"showDataTips,attr,omitempty"`

0 commit comments

Comments
 (0)