فهرست منبع

support ShowError option in Pivot table (#802)

jinhyuk-kim-ca 4 سال پیش
والد
کامیت
b83a36a8ae
3فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 2 0
      pivotTable.go
  2. 1 0
      pivotTable_test.go
  3. 2 2
      xmlPivotTable.go

+ 2 - 0
pivotTable.go

@@ -34,6 +34,7 @@ type PivotTableOption struct {
 	PageOverThenDown    bool
 	MergeItem           bool
 	CompactData         bool
+	ShowError           bool
 	ShowRowHeaders      bool
 	ShowColHeaders      bool
 	ShowRowStripes      bool
@@ -308,6 +309,7 @@ func (f *File) addPivotTable(cacheID, pivotTableID int, pivotTableXML string, op
 		PageOverThenDown:  &opt.PageOverThenDown,
 		MergeItem:         &opt.MergeItem,
 		CompactData:       &opt.CompactData,
+		ShowError:         &opt.ShowError,
 		DataCaption:       "Values",
 		Location: &xlsxLocation{
 			Ref:            hcell + ":" + vcell,

+ 1 - 0
pivotTable_test.go

@@ -38,6 +38,7 @@ func TestAddPivotTable(t *testing.T) {
 		ShowRowHeaders:  true,
 		ShowColHeaders:  true,
 		ShowLastColumn:  true,
+		ShowError:       true,
 	}))
 	// Use different order of coordinate tests
 	assert.NoError(t, f.AddPivotTable(&PivotTableOption{

+ 2 - 2
xmlPivotTable.go

@@ -31,7 +31,7 @@ type xlsxPivotTableDefinition struct {
 	DataCaption             string                   `xml:"dataCaption,attr"`
 	GrandTotalCaption       string                   `xml:"grandTotalCaption,attr,omitempty"`
 	ErrorCaption            string                   `xml:"errorCaption,attr,omitempty"`
-	ShowError               bool                     `xml:"showError,attr,omitempty"`
+	ShowError               *bool                    `xml:"showError,attr"`
 	MissingCaption          string                   `xml:"missingCaption,attr,omitempty"`
 	ShowMissing             bool                     `xml:"showMissing,attr,omitempty"`
 	PageStyle               string                   `xml:"pageStyle,attr,omitempty"`
@@ -48,7 +48,7 @@ type xlsxPivotTableDefinition struct {
 	VisualTotals            bool                     `xml:"visualTotals,attr,omitempty"`
 	ShowMultipleLabel       bool                     `xml:"showMultipleLabel,attr,omitempty"`
 	ShowDataDropDown        bool                     `xml:"showDataDropDown,attr,omitempty"`
-	ShowDrill               *bool                    `xml:"showDrill,attr,omitempty"`
+	ShowDrill               *bool                    `xml:"showDrill,attr"`
 	PrintDrill              bool                     `xml:"printDrill,attr,omitempty"`
 	ShowMemberPropertyTips  bool                     `xml:"showMemberPropertyTips,attr,omitempty"`
 	ShowDataTips            bool                     `xml:"showDataTips,attr,omitempty"`