diff options
author | Ludovic Braconnier <lb.braconnier@gmail.com> | 2020-09-30 18:20:11 +0200 |
---|---|---|
committer | Ludovic Braconnier <lb.braconnier@gmail.com> | 2020-09-30 18:20:11 +0200 |
commit | 2bd359bd01312bedd1b5f76f68765d1d66fa9a95 (patch) | |
tree | c935bd039caade26ba846cd6f73cfcf9a7441da0 /pivotTable.go | |
parent | c49222023756d6740877f286cb7d3e7a5a0950eb (diff) |
fix pivot fails in case of multi columns and multi data
Diffstat (limited to 'pivotTable.go')
-rw-r--r-- | pivotTable.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/pivotTable.go b/pivotTable.go index a197c1f..b7c80c2 100644 --- a/pivotTable.go +++ b/pivotTable.go @@ -485,6 +485,13 @@ func (f *File) addPivotColFields(pt *xlsxPivotTableDefinition, opt *PivotTableOp }) } + //in order to create pivot in case there is many Columns and Many Datas + if len(opt.Data) > 1 { + pt.ColFields.Field = append(pt.ColFields.Field, &xlsxField{ + X: -2, + }) + } + // count col fields pt.ColFields.Count = len(pt.ColFields.Field) return err |