Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is PivotTable:xlsxDataField.ShowDataAs Can be used ? #1939

Open
ShowerBandV opened this issue Jul 3, 2024 · 0 comments
Open

Is PivotTable:xlsxDataField.ShowDataAs Can be used ? #1939

ShowerBandV opened this issue Jul 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@ShowerBandV
Copy link
Contributor

XlsxDataField extracts ShowDataAs, but PivotTableField does not use this field. Is there any plans to support the use of ShowDataAs in the PivotTableField struct next version?

// xlsxDataField represents a field from a source list, table, or database
// that contains data that is summarized in a PivotTable.
type xlsxDataField struct {
	Name       string      `xml:"name,attr,omitempty"`
	Fld        int         `xml:"fld,attr"`
	Subtotal   string      `xml:"subtotal,attr,omitempty"`
	ShowDataAs string      `xml:"showDataAs,attr,omitempty"`
	BaseField  int         `xml:"baseField,attr,omitempty"`
	BaseItem   int64       `xml:"baseItem,attr,omitempty"`
	NumFmtID   string      `xml:"numFmtId,attr,omitempty"`
	ExtLst     *xlsxExtLst `xml:"extLst"`
}

func (f *File) extractPivotTableFields(order []string, pt *xlsxPivotTableDefinition, opts *PivotTableOptions) {
	...
	if pt.DataFields != nil {
		for _, field := range pt.DataFields.DataField {
			opts.Data = append(opts.Data, PivotTableField{
				Data:     order[field.Fld],
				Name:     field.Name,
				Subtotal: cases.Title(language.English).String(field.Subtotal),
			})
		}
	}
}
@ShowerBandV ShowerBandV changed the title PivotTable:xlsxDataField.ShowDataAs Can be used Is PivotTable:xlsxDataField.ShowDataAs Can be used ? Jul 3, 2024
@xuri xuri added the enhancement New feature or request label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants