You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
10KB

  1. package excelize
  2. import "encoding/xml"
  3. // xlsxPivotCacheDefinition represents the pivotCacheDefinition part. This part
  4. // defines each field in the source data, including the name, the string
  5. // resources of the instance data (for shared items), and information about
  6. // the type of data that appears in the field.
  7. type xlsxPivotCacheDefinition struct {
  8. XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main pivotCacheDefinition"`
  9. RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
  10. Invalid bool `xml:"invalid,attr,omitempty"`
  11. SaveData bool `xml:"saveData,attr"`
  12. RefreshOnLoad bool `xml:"refreshOnLoad,attr,omitempty"`
  13. OptimizeMemory bool `xml:"optimizeMemory,attr,omitempty"`
  14. EnableRefresh bool `xml:"enableRefresh,attr,omitempty"`
  15. RefreshedBy string `xml:"refreshedBy,attr,omitempty"`
  16. RefreshedDate float64 `xml:"refreshedDate,attr,omitempty"`
  17. RefreshedDateIso float64 `xml:"refreshedDateIso,attr,omitempty"`
  18. BackgroundQuery bool `xml:"backgroundQuery,attr"`
  19. MissingItemsLimit int `xml:"missingItemsLimit,attr,omitempty"`
  20. CreatedVersion int `xml:"createdVersion,attr,omitempty"`
  21. RefreshedVersion int `xml:"refreshedVersion,attr,omitempty"`
  22. MinRefreshableVersion int `xml:"minRefreshableVersion,attr,omitempty"`
  23. RecordCount int `xml:"recordCount,attr,omitempty"`
  24. UpgradeOnRefresh bool `xml:"upgradeOnRefresh,attr,omitempty"`
  25. TupleCacheAttr bool `xml:"tupleCache,attr,omitempty"`
  26. SupportSubquery bool `xml:"supportSubquery,attr,omitempty"`
  27. SupportAdvancedDrill bool `xml:"supportAdvancedDrill,attr,omitempty"`
  28. CacheSource *xlsxCacheSource `xml:"cacheSource"`
  29. CacheFields *xlsxCacheFields `xml:"cacheFields"`
  30. CacheHierarchies *xlsxCacheHierarchies `xml:"cacheHierarchies"`
  31. Kpis *xlsxKpis `xml:"kpis"`
  32. TupleCache *xlsxTupleCache `xml:"tupleCache"`
  33. CalculatedItems *xlsxCalculatedItems `xml:"calculatedItems"`
  34. CalculatedMembers *xlsxCalculatedMembers `xml:"calculatedMembers"`
  35. Dimensions *xlsxDimensions `xml:"dimensions"`
  36. MeasureGroups *xlsxMeasureGroups `xml:"measureGroups"`
  37. Maps *xlsxMaps `xml:"maps"`
  38. ExtLst *xlsxExtLst `xml:"extLst"`
  39. }
  40. // xlsxCacheSource represents the description of data source whose data is
  41. // stored in the pivot cache. The data source refers to the underlying rows or
  42. // database records that provide the data for a PivotTable. You can create a
  43. // PivotTable report from a SpreadsheetML table, an external database
  44. // (including OLAP cubes), multiple SpreadsheetML worksheets, or another
  45. // PivotTable.
  46. type xlsxCacheSource struct {
  47. Type string `xml:"type,attr"`
  48. ConnectionID int `xml:"connectionId,attr,omitempty"`
  49. WorksheetSource *xlsxWorksheetSource `xml:"worksheetSource"`
  50. Consolidation *xlsxConsolidation `xml:"consolidation"`
  51. ExtLst *xlsxExtLst `xml:"extLst"`
  52. }
  53. // xlsxWorksheetSource represents the location of the source of the data that
  54. // is stored in the cache.
  55. type xlsxWorksheetSource struct {
  56. RID string `xml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships id,attr,omitempty"`
  57. Ref string `xml:"ref,attr,omitempty"`
  58. Name string `xml:"name,attr,omitempty"`
  59. Sheet string `xml:"sheet,attr,omitempty"`
  60. }
  61. // xlsxConsolidation represents the description of the PivotCache source using
  62. // multiple consolidation ranges. This element is used when the source of the
  63. // PivotTable is a collection of ranges in the workbook. The ranges are
  64. // specified in the rangeSets collection. The logic for how the application
  65. // consolidates the data in the ranges is application- defined.
  66. type xlsxConsolidation struct {
  67. }
  68. // xlsxCacheFields represents the collection of field definitions in the
  69. // source data.
  70. type xlsxCacheFields struct {
  71. Count int `xml:"count,attr"`
  72. CacheField []*xlsxCacheField `xml:"cacheField"`
  73. }
  74. // xlsxCacheField represent a single field in the PivotCache. This definition
  75. // contains information about the field, such as its source, data type, and
  76. // location within a level or hierarchy. The sharedItems element stores
  77. // additional information about the data in this field. If there are no shared
  78. // items, then values are stored directly in the pivotCacheRecords part.
  79. type xlsxCacheField struct {
  80. Name string `xml:"name,attr"`
  81. Caption string `xml:"caption,attr,omitempty"`
  82. PropertyName string `xml:"propertyName,attr,omitempty"`
  83. ServerField bool `xml:"serverField,attr,omitempty"`
  84. UniqueList bool `xml:"uniqueList,attr,omitempty"`
  85. NumFmtID int `xml:"numFmtId,attr"`
  86. Formula string `xml:"formula,attr,omitempty"`
  87. SQLType int `xml:"sqlType,attr,omitempty"`
  88. Hierarchy int `xml:"hierarchy,attr,omitempty"`
  89. Level int `xml:"level,attr,omitempty"`
  90. DatabaseField bool `xml:"databaseField,attr,omitempty"`
  91. MappingCount int `xml:"mappingCount,attr,omitempty"`
  92. MemberPropertyField bool `xml:"memberPropertyField,attr,omitempty"`
  93. SharedItems *xlsxSharedItems `xml:"sharedItems"`
  94. FieldGroup *xlsxFieldGroup `xml:"fieldGroup"`
  95. MpMap *xlsxX `xml:"mpMap"`
  96. ExtLst *xlsxExtLst `xml:"extLst"`
  97. }
  98. // xlsxSharedItems represents the collection of unique items for a field in
  99. // the PivotCacheDefinition. The sharedItems complex type stores data type and
  100. // formatting information about the data in a field. Items in the
  101. // PivotCacheDefinition can be shared in order to reduce the redundancy of
  102. // those values that are referenced in multiple places across all the
  103. // PivotTable parts.
  104. type xlsxSharedItems struct {
  105. ContainsSemiMixedTypes bool `xml:"containsSemiMixedTypes,attr,omitempty"`
  106. ContainsNonDate bool `xml:"containsNonDate,attr,omitempty"`
  107. ContainsDate bool `xml:"containsDate,attr,omitempty"`
  108. ContainsString bool `xml:"containsString,attr,omitempty"`
  109. ContainsBlank bool `xml:"containsBlank,attr,omitempty"`
  110. ContainsMixedTypes bool `xml:"containsMixedTypes,attr,omitempty"`
  111. ContainsNumber bool `xml:"containsNumber,attr,omitempty"`
  112. ContainsInteger bool `xml:"containsInteger,attr,omitempty"`
  113. MinValue float64 `xml:"minValue,attr,omitempty"`
  114. MaxValue float64 `xml:"maxValue,attr,omitempty"`
  115. MinDate string `xml:"minDate,attr,omitempty"`
  116. MaxDate string `xml:"maxDate,attr,omitempty"`
  117. Count int `xml:"count,attr"`
  118. LongText bool `xml:"longText,attr,omitempty"`
  119. M *xlsxMissing `xml:"m"`
  120. N *xlsxNumber `xml:"n"`
  121. B *xlsxBoolean `xml:"b"`
  122. E *xlsxError `xml:"e"`
  123. S *xlsxString `xml:"s"`
  124. D *xlsxDateTime `xml:"d"`
  125. }
  126. // xlsxMissing represents a value that was not specified.
  127. type xlsxMissing struct {
  128. }
  129. // xlsxNumber represents a numeric value in the PivotTable.
  130. type xlsxNumber struct {
  131. V float64 `xml:"v,attr"`
  132. U bool `xml:"u,attr,omitempty"`
  133. F bool `xml:"f,attr,omitempty"`
  134. C string `xml:"c,attr,omitempty"`
  135. Cp int `xml:"cp,attr,omitempty"`
  136. In int `xml:"in,attr,omitempty"`
  137. Bc string `xml:"bc,attr,omitempty"`
  138. Fc string `xml:"fc,attr,omitempty"`
  139. I bool `xml:"i,attr,omitempty"`
  140. Un bool `xml:"un,attr,omitempty"`
  141. St bool `xml:"st,attr,omitempty"`
  142. B bool `xml:"b,attr,omitempty"`
  143. Tpls *xlsxTuples `xml:"tpls"`
  144. X *attrValInt `xml:"x"`
  145. }
  146. // xlsxTuples represents members for the OLAP sheet data entry, also known as
  147. // a tuple.
  148. type xlsxTuples struct {
  149. }
  150. // xlsxBoolean represents a boolean value for an item in the PivotTable.
  151. type xlsxBoolean struct {
  152. }
  153. // xlsxError represents an error value. The use of this item indicates that an
  154. // error value is present in the PivotTable source. The error is recorded in
  155. // the value attribute.
  156. type xlsxError struct {
  157. }
  158. // xlsxString represents a character value in a PivotTable.
  159. type xlsxString struct {
  160. }
  161. // xlsxDateTime represents a date-time value in the PivotTable.
  162. type xlsxDateTime struct {
  163. }
  164. // xlsxFieldGroup represents the collection of properties for a field group.
  165. type xlsxFieldGroup struct {
  166. }
  167. // xlsxCacheHierarchies represents the collection of OLAP hierarchies in the
  168. // PivotCache.
  169. type xlsxCacheHierarchies struct {
  170. }
  171. // xlsxKpis represents the collection of Key Performance Indicators (KPIs)
  172. // defined on the OLAP server and stored in the PivotCache.
  173. type xlsxKpis struct {
  174. }
  175. // xlsxTupleCache represents the cache of OLAP sheet data members, or tuples.
  176. type xlsxTupleCache struct {
  177. }
  178. // xlsxCalculatedItems represents the collection of calculated items.
  179. type xlsxCalculatedItems struct {
  180. }
  181. // xlsxCalculatedMembers represents the collection of calculated members in an
  182. // OLAP PivotTable.
  183. type xlsxCalculatedMembers struct {
  184. }
  185. // xlsxDimensions represents the collection of PivotTable OLAP dimensions.
  186. type xlsxDimensions struct {
  187. }
  188. // xlsxMeasureGroups represents the collection of PivotTable OLAP measure
  189. // groups.
  190. type xlsxMeasureGroups struct {
  191. }
  192. // xlsxMaps represents the PivotTable OLAP measure group - Dimension maps.
  193. type xlsxMaps struct {
  194. }