Skip to content

Commit

Permalink
This closes #1203, supporting same field used for pivot table data an…
Browse files Browse the repository at this point in the history
…d rows/cols
  • Loading branch information
xuri committed Apr 19, 2022
1 parent 0b8965d commit c2be30c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pivotTable.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ func (f *File) addPivotFields(pt *xlsxPivotTableDefinition, opt *PivotTableOptio
pt.PivotFields.PivotField = append(pt.PivotFields.PivotField, &xlsxPivotField{
Name: f.getPivotTableFieldName(name, opt.Rows),
Axis: "axisRow",
DataField: inPivotTableField(opt.Data, name) != -1,
Compact: &rowOptions.Compact,
Outline: &rowOptions.Outline,
DefaultSubtotal: &rowOptions.DefaultSubtotal,
Expand All @@ -554,8 +555,9 @@ func (f *File) addPivotFields(pt *xlsxPivotTableDefinition, opt *PivotTableOptio
}
if inPivotTableField(opt.Filter, name) != -1 {
pt.PivotFields.PivotField = append(pt.PivotFields.PivotField, &xlsxPivotField{
Axis: "axisPage",
Name: f.getPivotTableFieldName(name, opt.Columns),
Axis: "axisPage",
DataField: inPivotTableField(opt.Data, name) != -1,
Name: f.getPivotTableFieldName(name, opt.Columns),
Items: &xlsxItems{
Count: 1,
Item: []*xlsxItem{
Expand All @@ -576,6 +578,7 @@ func (f *File) addPivotFields(pt *xlsxPivotTableDefinition, opt *PivotTableOptio
pt.PivotFields.PivotField = append(pt.PivotFields.PivotField, &xlsxPivotField{
Name: f.getPivotTableFieldName(name, opt.Columns),
Axis: "axisCol",
DataField: inPivotTableField(opt.Data, name) != -1,
Compact: &columnOptions.Compact,
Outline: &columnOptions.Outline,
DefaultSubtotal: &columnOptions.DefaultSubtotal,
Expand Down

0 comments on commit c2be30c

Please sign in to comment.