LibreOffice Module sc (master)  1
xepivot.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XEPIVOT_HXX
21 #define INCLUDED_SC_SOURCE_FILTER_INC_XEPIVOT_HXX
22 
23 #include "xerecord.hxx"
24 #include "xlpivot.hxx"
25 #include "xeroot.hxx"
26 
27 class ScDPObject;
28 class ScDPSaveData;
29 class ScDPSaveDimension;
30 class ScDPSaveMember;
32 struct ScDPNumGroupInfo;
33 
34 // Pivot cache
35 
37 class XclExpPCItem : public XclExpRecord, public XclPCItem
38 {
39 public:
40  explicit XclExpPCItem( const OUString& rText );
41  explicit XclExpPCItem( double fValue, const OUString& rText = OUString() );
42  explicit XclExpPCItem( const DateTime& rDateTime, const OUString& rText = OUString() );
43  explicit XclExpPCItem( sal_Int16 nValue );
44  explicit XclExpPCItem( bool bValue, const OUString& rText );
45 
46  sal_uInt16 GetTypeFlag() const { return mnTypeFlag; }
47 
48  bool EqualsText( const OUString& rText ) const;
49  bool EqualsDouble( double fValue ) const;
50  bool EqualsDateTime( const DateTime& rDateTime ) const;
51  bool EqualsBool( bool bValue ) const;
52 
53 private:
54  virtual void WriteBody( XclExpStream& rStrm ) override;
55 
56 private:
57  sal_uInt16 mnTypeFlag;
58 };
59 
60 class XclExpPCField : public XclExpRecord, public XclPCField, protected XclExpRoot
61 {
62 public:
64  explicit XclExpPCField( const XclExpRoot& rRoot,
65  sal_uInt16 nFieldIdx,
66  const ScDPObject& rDPObj, const ScRange& rRange );
68  explicit XclExpPCField( const XclExpRoot& rRoot,
69  sal_uInt16 nFieldIdx,
70  const ScDPObject& rDPObj, const ScDPSaveGroupDimension& rGroupDim,
71  const XclExpPCField& rBaseField );
72  virtual ~XclExpPCField() override;
73 
75  void SetGroupChildField( const XclExpPCField& rChildField );
76 
78  const OUString& GetFieldName() const { return maFieldInfo.maName; }
79 
81  sal_uInt16 GetItemCount() const;
83  const XclExpPCItem* GetItem( sal_uInt16 nItemIdx ) const;
85  sal_uInt16 GetItemIndex( const OUString& rItemName ) const;
86 
88  std::size_t GetIndexSize() const;
90  void WriteIndex( XclExpStream& rStrm, sal_uInt32 nSrcRow ) const;
91 
93  virtual void Save( XclExpStream& rStrm ) override;
94 
95 private:
97 
101  const XclExpPCItemList& GetVisItemList() const;
102 
104  void InitStandardField( const ScRange& rRange );
106  void InitStdGroupField( const XclExpPCField& rBaseField, const ScDPSaveGroupDimension& rGroupDim );
108  void InitNumGroupField( const ScDPObject& rDPObj, const ScDPNumGroupInfo& rNumInfo );
110  void InitDateGroupField( const ScDPObject& rDPObj, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nDatePart );
111 
113  void InsertItemArrayIndex( size_t nListPos );
115  void InsertOrigItem( XclExpPCItem* pNewItem );
117  void InsertOrigTextItem( const OUString& rText );
119  void InsertOrigDoubleItem( double fValue, const OUString& rText );
121  void InsertOrigDateTimeItem( const DateTime& rDateTime, const OUString& rText );
123  void InsertOrigBoolItem( bool bValue, const OUString& rText );
124 
127  sal_uInt16 InsertGroupItem( XclExpPCItem* pNewItem );
129  void InsertNumDateGroupItems( const ScDPObject& rDPObj, const ScDPNumGroupInfo& rNumInfo, sal_Int32 nDatePart = 0 );
130 
132  void SetNumGroupLimit( const ScDPNumGroupInfo& rNumInfo );
135  void SetDateGroupLimit( const ScDPNumGroupInfo& rDateInfo, bool bUseStep );
136 
138  void Finalize();
139 
141  void WriteSxnumgroup( XclExpStream& rStrm );
143  void WriteSxgroupinfo( XclExpStream& rStrm );
144 
146  virtual void WriteBody( XclExpStream& rStrm ) override;
147 
148 private:
149  XclExpPCItemList maOrigItemList;
150  XclExpPCItemList maGroupItemList;
152  XclExpPCItemList maNumGroupLimits;
153  sal_uInt16 mnTypeFlags;
154 };
155 
157 {
158 public:
159  explicit XclExpPivotCache( const XclExpRoot& rRoot,
160  const ScDPObject& rDPObj, sal_uInt16 nListIdx );
161 
163  bool IsValid() const { return mbValid; }
165  bool HasItemIndexList() const;
166 
168  sal_uInt16 GetCacheIndex() const { return mnListIdx; }
169 
171  sal_uInt16 GetFieldCount() const;
173  const XclExpPCField* GetField( sal_uInt16 nFieldIdx ) const;
175  bool HasAddFields() const;
176 
178  bool HasEqualDataSource( const ScDPObject& rDPObj ) const;
179 
181  void Save( XclExpStream& rStrm );
182  static void SaveXml( XclExpXmlStream& rStrm );
183 
184 private:
186  void AddFields( const ScDPObject& rDPObj );
187 
189  void AddStdFields( const ScDPObject& rDPObj );
191  void AddGroupFields( const ScDPObject& rDPObj );
192 
194  void WriteDconref( XclExpStream& rStrm ) const;
196  void WriteDConName( XclExpStream& rStrm ) const;
197 
199  void WriteCacheStream();
201  void WriteSxdb( XclExpStream& rStrm ) const;
203  static void WriteSxdbex( XclExpStream& rStrm );
205  void WriteSxindexlistList( XclExpStream& rStrm ) const;
206 
207 private:
210 
212  XclExpPCFieldList maFieldList;
213  OUString maTabName;
214  OUString maSrcRangeName;
218  sal_uInt16 mnListIdx;
219  bool mbValid;
220 };
221 
223 
224 // Pivot table
225 
227 
229 typedef ::std::pair< sal_uInt16, sal_uInt16 > XclPTDataFieldPos;
230 
232 {
233 public:
234  explicit XclExpPTItem( const XclExpPCField& rCacheField, sal_uInt16 nCacheIdx );
235  explicit XclExpPTItem( sal_uInt16 nItemType, sal_uInt16 nCacheIdx );
236 
238  OUString GetItemName() const;
239 
241  void SetPropertiesFromMember( const ScDPSaveMember& rSaveMem );
242 
243 private:
245  virtual void WriteBody( XclExpStream& rStrm ) override;
246 
247 private:
250 };
251 
253 {
254 public:
255  explicit XclExpPTField( const XclExpPivotTable& rPTable, sal_uInt16 nCacheIdx );
256 
257  // data access ------------------------------------------------------------
258 
260  OUString GetFieldName() const;
264  sal_uInt16 GetFieldIndex() const { return maFieldInfo.mnCacheIdx; }
265 
267  sal_uInt16 GetLastDataInfoIndex() const;
268 
271  sal_uInt16 GetItemIndex( const OUString& rName, sal_uInt16 nDefaultIdx ) const;
272 
273  // fill data --------------------------------------------------------------
274 
276  void SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim );
278  void SetDataPropertiesFromDim( const ScDPSaveDimension& rSaveDim );
279 
281  void AppendSubtotalItems();
282 
283  // records ----------------------------------------------------------------
284 
286  void WriteSxpiEntry( XclExpStream& rStrm ) const;
288  void WriteSxdi( XclExpStream& rStrm, sal_uInt16 nDataInfoIdx ) const;
289 
291  virtual void Save( XclExpStream& rStrm ) override;
292 
293 private:
295  XclExpPTItem* GetItemAcc( const OUString& rName );
296 
298  void AppendSubtotalItem( sal_uInt16 nItemType );
299 
301  void WriteSxvd( XclExpStream& rStrm ) const;
303  void WriteSxvdex( XclExpStream& rStrm ) const;
304 
305 private:
306 
312  std::vector< XclPTDataFieldInfo >
316 };
317 
319 {
320 public:
321  explicit XclExpPivotTable( const XclExpRoot& rRoot,
322  const ScDPObject& rDPObj, const XclExpPivotCache& rPCache );
323 
325  const XclExpPCField* GetCacheField( sal_uInt16 nCacheIdx ) const;
326 
328  SCTAB GetScTab() const { return mnOutScTab; }
329 
331  const XclExpPTField* GetField( sal_uInt16 nFieldIdx ) const;
333  const XclExpPTField* GetField( const OUString& rName ) const;
334 
337  sal_uInt16 GetDataFieldIndex( const OUString& rName, sal_uInt16 nDefaultIdx ) const;
338 
340  virtual void Save( XclExpStream& rStrm ) override;
341 
342 private:
344  XclExpPTField* GetFieldAcc( const OUString& rName );
346  XclExpPTField* GetFieldAcc( const ScDPSaveDimension& rSaveDim );
347 
348  // fill data --------------------------------------------------------------
349 
351  void SetPropertiesFromDP( const ScDPSaveData& rSaveData );
353  void SetFieldPropertiesFromDim( const ScDPSaveDimension& rSaveDim );
355  void SetDataFieldPropertiesFromDim( const ScDPSaveDimension& rSaveDim );
356 
358  void Finalize();
359 
360  // records ----------------------------------------------------------------
361 
363  void WriteSxview( XclExpStream& rStrm ) const;
365  static void WriteSxivd( XclExpStream& rStrm, const ScfUInt16Vec& rFields );
367  void WriteSxpi( XclExpStream& rStrm ) const;
369  void WriteSxdiList( XclExpStream& rStrm ) const;
371  static void WriteSxli( XclExpStream& rStrm, sal_uInt16 nLineCount, sal_uInt16 nIndexCount );
373  void WriteSxex( XclExpStream& rStrm ) const;
374 
375  void WriteQsiSxTag( XclExpStream& rStrm ) const;
377  void WriteSxViewEx9( XclExpStream& rStrm ) const;
378 
379 private:
382 
387  XclExpPTFieldList maFieldList;
391  std::vector< XclPTDataFieldPos >
395  bool mbValid;
396  bool mbFilterBtn;
397 };
398 
407 {
408 public:
409  explicit XclExpPivotTableManager( const XclExpRoot& rRoot );
410 
412  void CreatePivotTables();
413 
418 
422  void WritePivotTables( XclExpStream& rStrm, SCTAB nScTab );
423 
424 private:
427  const XclExpPivotCache* CreatePivotCache( const ScDPObject& rDPObj );
428 
429 private:
432 
434  XclExpPivotTableList maPTableList;
435 };
436 
437 #endif
438 
439 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const XclExpPCField * mpCacheField
Parent pivot table containing this field.
Definition: xepivot.hxx:308
void AppendSubtotalItems()
Appends special items describing the field subtotal entries.
Definition: xepivot.cxx:1098
void InsertItemArrayIndex(size_t nListPos)
Inserts the passed index into the item index array of original items.
Definition: xepivot.cxx:442
sal_uInt16 GetItemCount() const
Returns the number of visible items of this field.
Definition: xepivot.cxx:261
void SetPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills this field with row/column/page properties from the passed save dimension.
Definition: xepivot.cxx:996
std::vector< XclPTDataFieldInfo > maDataInfoVec
Page field info (entry in SXPI record).
Definition: xepivot.hxx:313
ScRange maExpSrcRange
The original sheet source range.
Definition: xepivot.hxx:216
XclExpPTField maDataOrientField
Data field indexes.
Definition: xepivot.hxx:393
bool HasAddFields() const
Returns true, if this pivot cache contains non-standard fields (e.g.
Definition: xepivot.cxx:690
bool HasEqualDataSource(const ScDPObject &rDPObj) const
Returns true, if the passed DP object has the same data source as this cache.
Definition: xepivot.cxx:696
void WriteSxdiList(XclExpStream &rStrm) const
Writes all SXDI records containing info about the data fields.
Definition: xepivot.cxx:1477
XclExpPCItem(const OUString &rText)
Definition: xepivot.cxx:94
void SetGroupChildField(const XclExpPCField &rChildField)
Sets the passed field as direct grouping child field of this field.
Definition: xepivot.cxx:253
virtual void Save(XclExpStream &rStrm) override
Writes the pivot cache field and all items and other related records.
Definition: xepivot.cxx:298
Pivot table autoformat settings (SXVIEWEX9 record).
Definition: xlpivot.hxx:752
XclPTExtInfo maPTExtInfo
Info about the pivot table (SXVIEW record).
Definition: xepivot.hxx:385
This class is used to export Excel record streams.
Definition: xestream.hxx:71
sal_uInt16 mnListIdx
The range used to build the cache fields and items.
Definition: xepivot.hxx:218
void SetFieldPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills a pivot table field with all properties from the passed save dimension.
Definition: xepivot.cxx:1319
ScfUInt16Vec maIndexVec
List with grouping items.
Definition: xepivot.hxx:151
XclExpPivotTableList::RecordRefType XclExpPivotTableRef
Definition: xepivot.hxx:431
sal_uInt16 mnCacheIdx
Number of items of this field.
Definition: xlpivot.hxx:598
Extended information about a pivot table (SXEX record).
Definition: xlpivot.hxx:735
bool IsValid() const
Returns true, if the cache has been constructed successfully.
Definition: xepivot.hxx:163
void WriteSxpi(XclExpStream &rStrm) const
Writes the SXPI record containing page field info.
Definition: xepivot.cxx:1461
void CreatePivotTables()
Creates all pivot tables and caches from the Calc DataPilot objects.
Definition: xepivot.cxx:1620
XclExpPivotTable(const XclExpRoot &rRoot, const ScDPObject &rDPObj, const XclExpPivotCache &rPCache)
Definition: xepivot.cxx:1173
std::size_t GetIndexSize() const
Returns the size an item index needs to write out.
Definition: xepivot.cxx:280
void WriteSxex(XclExpStream &rStrm) const
Writes the SXEX records containing additional pivot table info.
Definition: xepivot.cxx:1511
const XclExpPivotTable & mrPTable
Definition: xepivot.hxx:307
const XclExpPCItem * mpCacheItem
Definition: xepivot.hxx:248
XclExpPCItemList maGroupItemList
List with original items.
Definition: xepivot.hxx:150
XclExpRecordList< XclExpPivotCache > maPCacheList
Definition: xepivot.hxx:433
static void WriteSxivd(XclExpStream &rStrm, const ScfUInt16Vec &rFields)
Writes an SXIVD record for row field or column field order.
Definition: xepivot.cxx:1450
void SetPropertiesFromMember(const ScDPSaveMember &rSaveMem)
Fills this item with properties from the passed save member.
Definition: xepivot.cxx:916
ScfUInt16Vec maRowFields
All fields in pivot cache order.
Definition: xepivot.hxx:388
bool mbFilterBtn
true = The pivot table is valid for export.
Definition: xepivot.hxx:396
const XclExpPCItem * GetItem(sal_uInt16 nItemIdx) const
Returns the specified pivot cache item (returns visible items in groupings).
Definition: xepivot.cxx:266
Represents a field in a pivot cache.
Definition: xlpivot.hxx:477
sal_uInt16 GetItemIndex(const OUString &rName, sal_uInt16 nDefaultIdx) const
Returns the list index of an item by its name.
Definition: xepivot.cxx:961
bool EqualsText(const OUString &rText) const
Definition: xepivot.cxx:133
void WriteSxpiEntry(XclExpStream &rStrm) const
Writes an entry for an SXPI record containing own page field info.
Definition: xepivot.cxx:1116
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
Definition: xepivot.cxx:153
XclExpRecordList< XclExpPCItem > XclExpPCItemList
Definition: xepivot.hxx:96
void WritePivotTables(XclExpStream &rStrm, SCTAB nScTab)
Writes all pivot tables of the specified Calc sheet.
Definition: xepivot.cxx:1646
OUString GetFieldName() const
Returns the name of this field.
Definition: xepivot.cxx:949
XclExpRecordRef CreatePivotCachesRecord()
Creates a record wrapper for exporting all pivot caches.
Definition: xepivot.cxx:1631
rtl::Reference< XclExpPivotCache > XclExpPivotCacheRef
Definition: xepivot.hxx:222
XclExpPTItem * GetItemAcc(const OUString &rName)
Returns an item by its name.
Definition: xepivot.cxx:1144
const OUString & GetFieldName() const
Returns the name of this cache field.
Definition: xepivot.hxx:78
XclPTPageFieldInfo maPageInfo
Extended field info (SXVDEX record).
Definition: xepivot.hxx:311
Access to global data from other classes.
Definition: xeroot.hxx:113
virtual void Save(XclExpStream &rStrm) override
Writes the entire pivot table field.
Definition: xepivot.cxx:1132
XclExpPTItem(const XclExpPCField &rCacheField, sal_uInt16 nCacheIdx)
Definition: xepivot.cxx:893
SCTAB GetScTab() const
Returns the output range of the pivot table.
Definition: xepivot.hxx:328
SCTAB mnOutScTab
Special data field orientation field.
Definition: xepivot.hxx:394
const XclExpPCField * GetField(sal_uInt16 nFieldIdx) const
Returns the specified pivot cache field.
Definition: xepivot.cxx:685
XclExpRecordList< XclExpPTItem > maItemList
List of extended data field info (SXDI records).
Definition: xepivot.hxx:315
XclExpPCItemList maOrigItemList
Definition: xepivot.hxx:149
sal_uInt16 InsertGroupItem(XclExpPCItem *pNewItem)
Inserts an item into the grouping item list.
Definition: xepivot.cxx:502
Contains extended data for a pivot table field (SXVDEX record).
Definition: xlpivot.hxx:621
bool HasItemIndexList() const
Returns true, if the item index list will be written.
Definition: xepivot.cxx:675
void SetNumGroupLimit(const ScDPNumGroupInfo &rNumInfo)
Inserts the SXDOUBLE items that specify the limits for a numeric grouping.
Definition: xepivot.cxx:543
void WriteSxvdex(XclExpStream &rStrm) const
Writes the SXVDEX record containing additional settings.
Definition: xepivot.cxx:1166
const XclExpPivotCache * CreatePivotCache(const ScDPObject &rDPObj)
Finds an existing (if enabled in mbShareCaches) or creates a new pivot cache.
Definition: xepivot.cxx:1656
Base class for all Excel records.
Definition: xerecord.hxx:39
void WriteSxdi(XclExpStream &rStrm, sal_uInt16 nDataInfoIdx) const
Writes an SXDI records containing info about a data field.
Definition: xepivot.cxx:1121
Contains data for a pivot table page field (part of SXPI record).
Definition: xlpivot.hxx:658
bool EqualsDateTime(const DateTime &rDateTime) const
Definition: xepivot.cxx:143
sal_uInt16 GetTypeFlag() const
Definition: xepivot.hxx:46
void InsertOrigDoubleItem(double fValue, const OUString &rText)
Inserts an original value item, if it is not contained already.
Definition: xepivot.cxx:469
::std::pair< sal_uInt16, sal_uInt16 > XclPTDataFieldPos
Data field position specifying the pivot table field index (first) and data info index (second)...
Definition: xepivot.hxx:226
void InitDateGroupField(const ScDPObject &rDPObj, const ScDPNumGroupInfo &rDateInfo, sal_Int32 nDatePart)
Initializes a date grouping field.
Definition: xepivot.cxx:426
void SetDateGroupLimit(const ScDPNumGroupInfo &rDateInfo, bool bUseStep)
Inserts the SXDATETIME/SXINTEGER items that specify the limits for a date grouping.
Definition: xepivot.cxx:552
Contains data for a pivot table field (SXVD record).
Definition: xlpivot.hxx:592
XclExpPivotTableList maPTableList
List of all pivot caches.
Definition: xepivot.hxx:434
void SetDataFieldPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills a pivot table data field with all properties from the passed save dimension.
Definition: xepivot.cxx:1356
void WriteSxindexlistList(XclExpStream &rStrm) const
Writes the SXINDEXLIST record list containing the item index table.
Definition: xepivot.cxx:841
XclPTFieldExtInfo maFieldExtInfo
General field info (SXVD record).
Definition: xepivot.hxx:310
OUString GetItemName() const
Returns the internal name of this item.
Definition: xepivot.cxx:911
XclExpPCItemList maNumGroupLimits
Indexes into maItemList.
Definition: xepivot.hxx:152
void AddFields(const ScDPObject &rDPObj)
Adds all pivot cache fields.
Definition: xepivot.cxx:729
void WriteSxview(XclExpStream &rStrm) const
Writes the SXVIEW record starting the pivot table.
Definition: xepivot.cxx:1443
void AppendSubtotalItem(sal_uInt16 nItemType)
Appends a special item describing a field subtotal entry.
Definition: xepivot.cxx:1153
ScRange maOrigSrcRange
Range name for source data.
Definition: xepivot.hxx:215
void AddStdFields(const ScDPObject &rDPObj)
Adds all standard pivot cache fields based on source data.
Definition: xepivot.cxx:737
XclExpRecordList< XclExpPivotTable > XclExpPivotTableList
Definition: xepivot.hxx:430
void Finalize()
Initializes flags and item count fields.
Definition: xepivot.cxx:562
bool mbValid
List index in pivot cache buffer.
Definition: xepivot.hxx:219
ScfUInt16Vec maColFields
Row field indexes.
Definition: xepivot.hxx:389
The main class for pivot table export.
Definition: xepivot.hxx:406
virtual ~XclExpPCField() override
Definition: xepivot.cxx:249
XclExpRecordRef CreatePivotTablesRecord(SCTAB nScTab)
Creates a record wrapper for exporting all pivot tables of the specified sheet.
Definition: xepivot.cxx:1636
const XclExpPCItemList & GetVisItemList() const
Returns the item list that contains the visible items.
Definition: xepivot.cxx:317
Contains data for a pivot table data item (SXVI record).
Definition: xlpivot.hxx:575
void WriteIndex(XclExpStream &rStrm, sal_uInt32 nSrcRow) const
Writes the item index at the passed source row position as part of the SXINDEXLIST record...
Definition: xepivot.cxx:285
XclExpPCFieldList maFieldList
Pivot cache settings (SXDB record).
Definition: xepivot.hxx:212
void InsertOrigTextItem(const OUString &rText)
Inserts an original text item, if it is not contained already.
Definition: xepivot.cxx:456
void InsertOrigItem(XclExpPCItem *pNewItem)
Inserts an original source item.
Definition: xepivot.cxx:448
void WriteSxnumgroup(XclExpStream &rStrm)
Writes an SXNUMGROUP record and the additional items for a numeric grouping field.
Definition: xepivot.cxx:580
XclExpPTField(const XclExpPivotTable &rPTable, sal_uInt16 nCacheIdx)
Definition: xepivot.cxx:934
const int nIndexCount
Definition: qproform.cxx:567
sal_uInt16 GetCacheIndex() const
Returns the list index of the cache used in pivot table records.
Definition: xepivot.hxx:168
XclExpPTField * GetFieldAcc(const OUString &rName)
Returns a pivot table field by its name.
Definition: xepivot.cxx:1283
XclExpPivotCache(const XclExpRoot &rRoot, const ScDPObject &rDPObj, sal_uInt16 nListIdx)
Definition: xepivot.cxx:614
OUString maSrcRangeName
Name of source data sheet.
Definition: xepivot.hxx:214
bool EqualsDouble(double fValue) const
Definition: xepivot.cxx:138
void WriteCacheStream()
Creates the pivot cache storage stream and writes the cache.
Definition: xepivot.cxx:806
void SetPropertiesFromDP(const ScDPSaveData &rSaveData)
Fills internal members with all properties from the passed save data.
Definition: xepivot.cxx:1305
XclExpPCFieldList::RecordRefType XclExpPCFieldRef
Definition: xepivot.hxx:209
ScRange maDocSrcRange
The exported sheet source range.
Definition: xepivot.hxx:217
virtual void WriteBody(XclExpStream &rStrm) override
Writes the SXVI record body describing the pivot table item.
Definition: xepivot.cxx:929
void Save(XclExpStream &rStrm)
Writes related records into Workbook stream and creates the pivot cache storage stream.
Definition: xepivot.cxx:706
XclPCFieldInfo maFieldInfo
Definition: xlpivot.hxx:516
void WriteSxdb(XclExpStream &rStrm) const
Writes the SXDB record.
Definition: xepivot.cxx:826
const XclExpPivotCache & mrPCache
Definition: xepivot.hxx:383
bool EqualsBool(bool bValue) const
Definition: xepivot.cxx:148
XclExpPTFieldList::RecordRefType XclExpPTFieldRef
Definition: xepivot.hxx:381
Represents a data item in a pivot cache containing data of any type.
Definition: xepivot.hxx:37
void WriteSxvd(XclExpStream &rStrm) const
Writes the SXVD record introducing the field.
Definition: xepivot.cxx:1159
XclExpPCField(const XclExpRoot &rRoot, sal_uInt16 nFieldIdx, const ScDPObject &rDPObj, const ScRange &rRange)
Creates a standard pivot cache field, filled from sheet source data.
Definition: xepivot.cxx:189
static void WriteSxli(XclExpStream &rStrm, sal_uInt16 nLineCount, sal_uInt16 nIndexCount)
Writes a dummy SXLI records containing item layout info.
Definition: xepivot.cxx:1487
void InsertOrigBoolItem(bool bValue, const OUString &rText)
Inserts an original boolean item, if it is not contained already.
Definition: xepivot.cxx:491
XclPTViewEx9Info maPTViewEx9Info
Extended info about the pivot table (SXEX record).
Definition: xepivot.hxx:386
::std::vector< sal_uInt16 > ScfUInt16Vec
Definition: ftools.hxx:253
ScfUInt16Vec maPageFields
Column field indexes.
Definition: xepivot.hxx:390
XclExpPivotTableManager(const XclExpRoot &rRoot)
Definition: xepivot.cxx:1615
Contains data for a pivot cache (SXDB record).
Definition: xlpivot.hxx:526
XclExpRecordList< XclExpPCField > XclExpPCFieldList
Definition: xepivot.hxx:208
void WriteSxViewEx9(XclExpStream &rStrm) const
Writes the SX_AUTOFORMAT records with the autoformat id and header layout.
Definition: xepivot.cxx:1572
void InitStdGroupField(const XclExpPCField &rBaseField, const ScDPSaveGroupDimension &rGroupDim)
Initializes a standard grouping field.
Definition: xepivot.cxx:361
void AddGroupFields(const ScDPObject &rDPObj)
Adds all grouping pivot cache fields.
Definition: xepivot.cxx:752
XclPCInfo maPCInfo
Definition: xepivot.hxx:211
Represents a new group dimension whose dimension ID is higher than the highest source dimension ID...
Definition: dpdimsave.hxx:87
Contains data for a pivot table (SXVIEW record).
Definition: xlpivot.hxx:706
void WriteDConName(XclExpStream &rStrm) const
DCONNAME record contains range name source.
Definition: xepivot.cxx:798
XclExpPTFieldList maFieldList
The selected autoformat (SXVIEWEX9)
Definition: xepivot.hxx:387
XclPTInfo maPTInfo
The pivot cache this pivot table bases on.
Definition: xepivot.hxx:384
void Finalize()
Initializes any data after processing the entire source DataPilot.
Definition: xepivot.cxx:1367
void InsertNumDateGroupItems(const ScDPObject &rDPObj, const ScDPNumGroupInfo &rNumInfo, sal_Int32 nDatePart=0)
Generates and inserts all visible items for numeric or date grouping.
Definition: xepivot.cxx:508
XclPTFieldInfo maFieldInfo
The referred pivot cache field.
Definition: xepivot.hxx:309
XclPTItemInfo maItemInfo
The referred pivot cache item.
Definition: xepivot.hxx:249
void InitStandardField(const ScRange &rRange)
Initializes a standard field.
Definition: xepivot.cxx:324
OUString maTabName
List of all pivot cache fields.
Definition: xepivot.hxx:213
static void WriteSxdbex(XclExpStream &rStrm)
Writes the SXDBEX record.
Definition: xepivot.cxx:833
const XclExpPCField * GetCacheField(sal_uInt16 nCacheIdx) const
Returns a pivot cache field.
Definition: xepivot.cxx:1229
void WritePivotCaches(XclExpStream &rStrm)
Writes all pivot caches (all Workbook records and cache streams).
Definition: xepivot.cxx:1641
void SetDataPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills this field with data field properties from the passed save dimension.
Definition: xepivot.cxx:1064
virtual void Save(XclExpStream &rStrm) override
Writes the entire pivot table.
Definition: xepivot.cxx:1256
std::vector< XclPTDataFieldPos > maDataFields
Page field indexes.
Definition: xepivot.hxx:392
void InsertOrigDateTimeItem(const DateTime &rDateTime, const OUString &rText)
Inserts an original date/time item, if it is not contained already.
Definition: xepivot.cxx:480
static void SaveXml(XclExpXmlStream &rStrm)
Definition: xepivot.cxx:725
sal_uInt16 GetItemIndex(const OUString &rItemName) const
Returns the index of a pivot cache item, or EXC_PC_NOITEM on error.
Definition: xepivot.cxx:271
sal_uInt16 GetFieldCount() const
Returns the number of pivot cache fields.
Definition: xepivot.cxx:680
sal_uInt16 GetFieldIndex() const
Returns the pivot table field list index of this field.
Definition: xepivot.hxx:264
const XclExpPTField * GetField(sal_uInt16 nFieldIdx) const
Returns a pivot table field by its name.
Definition: xepivot.cxx:1234
void WriteDconref(XclExpStream &rStrm) const
Writes the DCONREF record containing the source range.
Definition: xepivot.cxx:785
void WriteSxgroupinfo(XclExpStream &rStrm)
Writes an SXGROUPINFO record describing the item order in grouping fields.
Definition: xepivot.cxx:596
XclExpRecordList< XclExpPTField > XclExpPTFieldList
Definition: xepivot.hxx:380
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SXFIELD record for this field.
Definition: xepivot.cxx:609
sal_uInt16 mnTypeFlag
Definition: xepivot.hxx:57
void SvStream & rStrm
bool mbValid
Sheet index of the output range.
Definition: xepivot.hxx:395
OUString maName
Definition: xlpivot.hxx:438
sal_uInt16 GetLastDataInfoIndex() const
Returns the index of the last inserted data info struct.
Definition: xepivot.cxx:954
void WriteQsiSxTag(XclExpStream &rStrm) const
Definition: xepivot.cxx:1518
void InitNumGroupField(const ScDPObject &rDPObj, const ScDPNumGroupInfo &rNumInfo)
Initializes a numeric grouping field.
Definition: xepivot.cxx:402
Base class for single records with any content.
Definition: xerecord.hxx:143
sal_Int16 SCTAB
Definition: types.hxx:23
sal_uInt16 mnTypeFlags
List with limit values for numeric grouping.
Definition: xepivot.hxx:153
sal_Int16 nValue
sal_uInt16 GetDataFieldIndex(const OUString &rName, sal_uInt16 nDefaultIdx) const
Returns the data-field-only index of the first data field with the passed name.
Definition: xepivot.cxx:1244
Represents a data item of any type in a pivot cache.
Definition: xlpivot.hxx:367