diff options
author | xuri <xuri.me@gmail.com> | 2020-10-01 19:04:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-01 19:04:19 +0800 |
commit | 9055a835a8c77b757e14cde22cc9daa3f9f0c66c (patch) | |
tree | c935bd039caade26ba846cd6f73cfcf9a7441da0 /pivotTable_test.go | |
parent | c49222023756d6740877f286cb7d3e7a5a0950eb (diff) | |
parent | 2bd359bd01312bedd1b5f76f68765d1d66fa9a95 (diff) |
Merge pull request #710 from lbraconnier2/Pivot-failed-in-case-of-multi-columns-and-multi-data
fix pivot fails in case of multi columns and multi data
Diffstat (limited to 'pivotTable_test.go')
-rw-r--r-- | pivotTable_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pivotTable_test.go b/pivotTable_test.go index 61bb07b..42103f3 100644 --- a/pivotTable_test.go +++ b/pivotTable_test.go @@ -135,6 +135,20 @@ func TestAddPivotTable(t *testing.T) { ShowColHeaders: true, ShowLastColumn: true, })) + //Test Pivot table with many data, many rows, many cols + assert.NoError(t, f.AddPivotTable(&PivotTableOption{ + DataRange: "Sheet1!$A$1:$E$31", + PivotTableRange: "Sheet2!$A$56:$AG$90", + Rows: []PivotTableField{{Data: "Month", DefaultSubtotal: true}, {Data: "Year"}}, + Columns: []PivotTableField{{Data: "Region", DefaultSubtotal: true}, {Data: "Type"}}, + Data: []PivotTableField{{Data: "Sales", Subtotal: "Sum", Name: "Sum of Sales"}, {Data: "Sales", Subtotal: "Average", Name: "Average of Sales"}}, + RowGrandTotals: true, + ColGrandTotals: true, + ShowDrill: true, + ShowRowHeaders: true, + ShowColHeaders: true, + ShowLastColumn: true, + })) // Test empty pivot table options assert.EqualError(t, f.AddPivotTable(nil), "parameter is required") |