Skip to content

Commit

Permalink
This closes qax-os#1203, supporting same field used for pivot table d…
Browse files Browse the repository at this point in the history
…ata and rows/cols
  • Loading branch information
xuri committed Oct 9, 2022
1 parent 1bb543d commit 3b14d7f
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 3b14d7f

Please sign in to comment.