summaryrefslogtreecommitdiff
path: root/pivotTable.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2020-09-15 23:31:24 +0800
committerxuri <xuri.me@gmail.com>2020-09-15 23:31:24 +0800
commit96917e4617c9e7eb15c0ee1723a042f169321430 (patch)
tree52811d13c431bcd9345eb1d37553dc0a519ce8d5 /pivotTable.go
parent97bffe608dfefe69a64fb450ae654ca798c710db (diff)
Update docs and test case for the pivot table
Diffstat (limited to 'pivotTable.go')
-rw-r--r--pivotTable.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/pivotTable.go b/pivotTable.go
index 3153f6e..0c1dd61 100644
--- a/pivotTable.go
+++ b/pivotTable.go
@@ -101,10 +101,16 @@ type PivotTableField struct {
// if err := f.AddPivotTable(&excelize.PivotTableOption{
// DataRange: "Sheet1!$A$1:$E$31",
// PivotTableRange: "Sheet1!$G$2:$M$34",
-// Rows: []excelize.PivotTableField{{Data: "Month"}, {Data: "Year"}},
+// Rows: []excelize.PivotTableField{{Data: "Month", DefaultSubtotal: true}, {Data: "Year"}},
// Filter: []excelize.PivotTableField{{Data: "Region"}},
-// Columns: []excelize.PivotTableField{{Data: "Type"}},
+// Columns: []excelize.PivotTableField{{Data: "Type", DefaultSubtotal: true}},
// Data: []excelize.PivotTableField{{Data: "Sales", Name: "Summarize", Subtotal: "Sum"}},
+// RowGrandTotals: true,
+// ColGrandTotals: true,
+// ShowDrill: true,
+// ShowRowHeaders: true,
+// ShowColHeaders: true,
+// ShowLastColumn: true,
// }); err != nil {
// fmt.Println(err)
// }
@@ -289,9 +295,8 @@ func (f *File) addPivotTable(cacheID, pivotTableID int, pivotTableXML string, op
pivotTableStyle := func() string {
if opt.PivotTableStyleName == "" {
return "PivotStyleLight16"
- } else {
- return opt.PivotTableStyleName
}
+ return opt.PivotTableStyleName
}
pt := xlsxPivotTableDefinition{
Name: fmt.Sprintf("Pivot Table%d", pivotTableID),