Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
此号慢热型
excelize
提交
b30c642e
excelize
项目概览
此号慢热型
/
excelize
与 Fork 源项目一致
Fork自
xuri / excelize
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
excelize
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b30c642e
编写于
9月 05, 2019
作者:
xurime
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Prepare pivot table support, add pivot table definition struct
上级
0acb3ef9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
289 addition
and
0 deletion
+289
-0
xmlPivotTable.go
xmlPivotTable.go
+289
-0
未找到文件。
xmlPivotTable.go
0 → 100644
浏览文件 @
b30c642e
// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of
// this source code is governed by a BSD-style license that can be found in
// the LICENSE file.
//
// Package excelize providing a set of functions that allow you to write to
// and read from XLSX files. Support reads and writes XLSX file generated by
// Microsoft Excel™ 2007 and later. Support save file without losing original
// charts of XLSX. This library needs Go version 1.10 or later.
package
excelize
import
"encoding/xml"
// xlsxPivotTableDefinition represents the PivotTable root element for
// non-null PivotTables. There exists one pivotTableDefinition for each
// PivotTableDefinition part
type
xlsxPivotTableDefinition
struct
{
XMLName
xml
.
Name
`xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main pivotTableDefinition"`
Name
string
`xml:"name,attr"`
CacheID
int
`xml:"cacheId,attr"`
DataOnRows
bool
`xml:"dataOnRows,attr"`
DataPosition
int
`xml:"dataPosition,attr"`
DataCaption
string
`xml:"dataCaption,attr"`
GrandTotalCaption
string
`xml:"grandTotalCaption,attr"`
ErrorCaption
string
`xml:"errorCaption,attr"`
ShowError
bool
`xml:"showError,attr"`
MissingCaption
string
`xml:"missingCaption,attr"`
ShowMissing
bool
`xml:"showMissing,attr"`
PageStyle
string
`xml:"pageStyle,attr"`
PivotTableStyle
string
`xml:"pivotTableStyle,attr"`
VacatedStyle
string
`xml:"vacatedStyle,attr"`
Tag
string
`xml:"tag,attr"`
UpdatedVersion
int
`xml:"updatedVersion,attr"`
MinRefreshableVersion
int
`xml:"minRefreshableVersion,attr"`
AsteriskTotals
bool
`xml:"asteriskTotals,attr"`
ShowItems
bool
`xml:"showItems,attr"`
EditData
bool
`xml:"editData,attr"`
DisableFieldList
bool
`xml:"disableFieldList,attr"`
ShowCalcMbrs
bool
`xml:"showCalcMbrs,attr"`
VisualTotals
bool
`xml:"visualTotals,attr"`
ShowMultipleLabel
bool
`xml:"showMultipleLabel,attr"`
ShowDataDropDown
bool
`xml:"showDataDropDown,attr"`
ShowDrill
bool
`xml:"showDrill,attr"`
PrintDrill
bool
`xml:"printDrill,attr"`
ShowMemberPropertyTips
bool
`xml:"showMemberPropertyTips,attr"`
ShowDataTips
bool
`xml:"showDataTips,attr"`
EnableWizard
bool
`xml:"enableWizard,attr"`
EnableDrill
bool
`xml:"enableDrill,attr"`
EnableFieldProperties
bool
`xml:"enableFieldProperties,attr"`
PreserveFormatting
bool
`xml:"preserveFormatting,attr"`
UseAutoFormatting
bool
`xml:"useAutoFormatting,attr"`
PageWrap
int
`xml:"pageWrap,attr"`
PageOverThenDown
bool
`xml:"pageOverThenDown,attr"`
SubtotalHiddenItems
bool
`xml:"subtotalHiddenItems,attr"`
RowGrandTotals
bool
`xml:"rowGrandTotals,attr"`
ColGrandTotals
bool
`xml:"colGrandTotals,attr"`
FieldPrintTitles
bool
`xml:"fieldPrintTitles,attr"`
ItemPrintTitles
bool
`xml:"itemPrintTitles,attr"`
MergeItem
bool
`xml:"mergeItem,attr"`
ShowDropZones
bool
`xml:"showDropZones,attr"`
CreatedVersion
int
`xml:"createdVersion,attr"`
Indent
int
`xml:"indent,attr"`
ShowEmptyRow
bool
`xml:"showEmptyRow,attr"`
ShowEmptyCol
bool
`xml:"showEmptyCol,attr"`
ShowHeaders
bool
`xml:"showHeaders,attr"`
Compact
bool
`xml:"compact,attr"`
Outline
bool
`xml:"outline,attr"`
OutlineData
bool
`xml:"outlineData,attr"`
CompactData
bool
`xml:"compactData,attr"`
Published
bool
`xml:"published,attr"`
GridDropZones
bool
`xml:"gridDropZones,attr"`
Immersive
bool
`xml:"immersive,attr"`
MultipleFieldFilters
bool
`xml:"multipleFieldFilters,attr"`
ChartFormat
int
`xml:"chartFormat,attr"`
RowHeaderCaption
string
`xml:"rowHeaderCaption,attr"`
ColHeaderCaption
string
`xml:"colHeaderCaption,attr"`
FieldListSortAscending
bool
`xml:"fieldListSortAscending,attr"`
MdxSubqueries
bool
`xml:"mdxSubqueries,attr"`
CustomListSort
bool
`xml:"customListSort,attr"`
Location
*
xlsxLocation
`xml:"location"`
PivotFields
*
xlsxPivotFields
`xml:"pivotFields"`
RowFields
*
xlsxRowFields
`xml:"rowFields"`
RowItems
*
xlsxRowItems
`xml:"rowItems"`
ColFields
*
xlsxColFields
`xml:"colFields"`
ColItems
*
xlsxColItems
`xml:"colItems"`
PageFields
*
xlsxPageFields
`xml:"pageFields"`
DataFields
*
xlsxDataFields
`xml:"dataFields"`
ConditionalFormats
*
xlsxConditionalFormats
`xml:"conditionalFormats"`
PivotTableStyleInfo
*
xlsxPivotTableStyleInfo
`xml:"pivotTableStyleInfo"`
}
// xlsxLocation represents location information for the PivotTable.
type
xlsxLocation
struct
{
Ref
string
`xml:"ref,attr"`
FirstHeaderRow
int
`xml:"firstHeaderRow,attr"`
FirstDataRow
int
`xml:"firstDataRow,attr"`
FirstDataCol
int
`xml:"firstDataCol,attr"`
RowPageCount
int
`xml:"rowPageCount,attr"`
ColPageCount
int
`xml:"colPageCount,attr"`
}
// xlsxPivotFields represents the collection of fields that appear on the
// PivotTable.
type
xlsxPivotFields
struct
{
Count
int
`xml:"count,attr"`
PivotField
[]
*
xlsxPivotField
`xml:"pivotField"`
}
// xlsxPivotField represents a single field in the PivotTable. This element
// contains information about the field, including the collection of items in
// the field.
type
xlsxPivotField
struct
{
Name
string
`xml:"name,attr"`
Axis
string
`xml:"axis,attr,omitempty"`
DataField
bool
`xml:"dataField,attr"`
SubtotalCaption
string
`xml:"subtotalCaption,attr"`
ShowDropDowns
bool
`xml:"showDropDowns,attr"`
HiddenLevel
bool
`xml:"hiddenLevel,attr"`
UniqueMemberProperty
string
`xml:"uniqueMemberProperty,attr"`
Compact
bool
`xml:"compact,attr"`
AllDrilled
bool
`xml:"allDrilled,attr"`
NumFmtId
string
`xml:"numFmtId,attr,omitempty"`
Outline
bool
`xml:"outline,attr"`
SubtotalTop
bool
`xml:"subtotalTop,attr"`
DragToRow
bool
`xml:"dragToRow,attr"`
DragToCol
bool
`xml:"dragToCol,attr"`
MultipleItemSelectionAllowed
bool
`xml:"multipleItemSelectionAllowed,attr"`
DragToPage
bool
`xml:"dragToPage,attr"`
DragToData
bool
`xml:"dragToData,attr"`
DragOff
bool
`xml:"dragOff,attr"`
ShowAll
bool
`xml:"showAll,attr"`
InsertBlankRow
bool
`xml:"insertBlankRow,attr"`
ServerField
bool
`xml:"serverField,attr"`
InsertPageBreak
bool
`xml:"insertPageBreak,attr"`
AutoShow
bool
`xml:"autoShow,attr"`
TopAutoShow
bool
`xml:"topAutoShow,attr"`
HideNewItems
bool
`xml:"hideNewItems,attr"`
MeasureFilter
bool
`xml:"measureFilter,attr"`
IncludeNewItemsInFilter
bool
`xml:"includeNewItemsInFilter,attr"`
ItemPageCount
int
`xml:"itemPageCount,attr"`
SortType
string
`xml:"sortType,attr"`
DataSourceSort
bool
`xml:"dataSourceSort,attr,omitempty"`
NonAutoSortDefault
bool
`xml:"nonAutoSortDefault,attr"`
RankBy
int
`xml:"rankBy,attr,omitempty"`
DefaultSubtotal
bool
`xml:"defaultSubtotal,attr"`
SumSubtotal
bool
`xml:"sumSubtotal,attr"`
CountASubtotal
bool
`xml:"countASubtotal,attr"`
AvgSubtotal
bool
`xml:"avgSubtotal,attr"`
MaxSubtotal
bool
`xml:"maxSubtotal,attr"`
MinSubtotal
bool
`xml:"minSubtotal,attr"`
ProductSubtotal
bool
`xml:"productSubtotal,attr"`
CountSubtotal
bool
`xml:"countSubtotal,attr"`
StdDevSubtotal
bool
`xml:"stdDevSubtotal,attr"`
StdDevPSubtotal
bool
`xml:"stdDevPSubtotal,attr"`
VarSubtotal
bool
`xml:"varSubtotal,attr"`
VarPSubtotal
bool
`xml:"varPSubtotal,attr"`
ShowPropCell
bool
`xml:"showPropCell,attr,omitempty"`
ShowPropTip
bool
`xml:"showPropTip,attr,omitempty"`
ShowPropAsCaption
bool
`xml:"showPropAsCaption,attr,omitempty"`
DefaultAttributeDrillState
bool
`xml:"defaultAttributeDrillState,attr,omitempty"`
Items
*
xlsxItems
`xml:"items"`
AutoSortScope
*
xlsxAutoSortScope
`xml:"autoSortScope"`
ExtLst
*
xlsxExtLst
`xml:"extLst"`
}
// xlsxItems represents the collection of items in a PivotTable field. The
// items in the collection are ordered by index. Items represent the unique
// entries from the field in the source data.
type
xlsxItems
struct
{
Count
int
`xml:"count,attr"`
Item
[]
*
xlsxItem
`xml:"item"`
}
// xlsxItem represents a single item in PivotTable field.
type
xlsxItem
struct
{
N
string
`xml:"n,attr"`
T
string
`xml:"t,attr"`
H
bool
`xml:"h,attr"`
S
bool
`xml:"s,attr"`
SD
bool
`xml:"sd,attr"`
F
bool
`xml:"f,attr"`
M
bool
`xml:"m,attr"`
C
bool
`xml:"c,attr"`
X
int
`xml:"x,attr,omitempty"`
D
bool
`xml:"d,attr"`
E
bool
`xml:"e,attr"`
}
// xlsxAutoSortScope represents the sorting scope for the PivotTable.
type
xlsxAutoSortScope
struct
{
}
// xlsxRowFields represents the collection of row fields for the PivotTable.
type
xlsxRowFields
struct
{
Count
int
`xml:"count,attr"`
Fields
[]
*
xlsxField
`xml:"fields"`
}
// xlsxField represents a generic field that can appear either on the column
// or the row region of the PivotTable. There areas many <x> elements as there
// are item values in any particular column or row.
type
xlsxField
struct
{
X
int
`xml:"x,attr"`
}
// xlsxRowItems represents the collection of items in row axis of the
// PivotTable.
type
xlsxRowItems
struct
{
Count
int
`xml:"count,attr"`
I
[]
*
xlsxI
`xml:"i"`
}
// xlsxI represents the collection of items in the row region of the
// PivotTable.
type
xlsxI
struct
{
X
[]
*
xlsxX
`xml:"x"`
}
// xlsxX represents an array of indexes to cached shared item values.
type
xlsxX
struct
{
XMLName
xml
.
Name
`xml:"x"`
}
// xlsxColFields represents the collection of fields that are on the column
// axis of the PivotTable.
type
xlsxColFields
struct
{
Count
int
`xml:"count,attr"`
Fields
[]
*
xlsxField
`xml:"fields"`
}
// xlsxColItems represents the collection of column items of the PivotTable.
type
xlsxColItems
struct
{
Count
int
`xml:"count,attr"`
I
[]
*
xlsxI
`xml:"i"`
}
// xlsxPageFields represents the collection of items in the page or report
// filter region of the PivotTable.
type
xlsxPageFields
struct
{
Count
int
`xml:"count,attr"`
PageField
[]
*
xlsxPageField
`xml:"pageField"`
}
// xlsxPageField represents a field on the page or report filter of the
// PivotTable.
type
xlsxPageField
struct
{
Fld
int
`xml:"fld,attr"`
Item
int
`xml:"item,attr,omitempty"`
Hier
int
`xml:"hier,attr"`
Name
string
`xml:"name,attr"`
Cap
string
`xml:"cap,attr"`
ExtLst
*
xlsxExtLst
`xml:"extLst"`
}
// xlsxDataFields represents the collection of items in the data region of the
// PivotTable.
type
xlsxDataFields
struct
{
Count
int
`xml:"count,attr"`
DataField
*
xlsxDataField
`xml:"dataField"`
}
// 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"`
ShowDataAs
string
`xml:"showDataAs,attr"`
BaseField
int
`xml:"baseField,attr"`
BaseItem
int64
`xml:"baseItem,attr"`
NumFmtId
string
`xml:"numFmtId,attr,omitempty"`
ExtLst
*
xlsxExtLst
`xml:"extLst"`
}
// xlsxConditionalFormats represents the collection of conditional formats
// applied to a PivotTable.
type
xlsxConditionalFormats
struct
{
}
// xlsxPivotTableStyleInfo represent information on style applied to the
// PivotTable.
type
xlsxPivotTableStyleInfo
struct
{
Name
string
`xml:"name,attr"`
ShowRowHeaders
bool
`xml:"showRowHeaders,attr"`
ShowColHeaders
bool
`xml:"showColHeaders,attr"`
ShowRowStripes
bool
`xml:"showRowStripes,attr"`
ShowColStripes
bool
`xml:"showColStripes,attr"`
ShowLastColumn
bool
`xml:"showLastColumn,attr,omitempty"`
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录