40 explicit XclExpPCItem(
double fValue,
const OUString& rText = OUString() );
43 explicit XclExpPCItem(
bool bValue,
const OUString& rText );
47 bool EqualsText( std::u16string_view rText )
const;
84 sal_uInt16
GetItemIndex( std::u16string_view rItemName )
const;
159 const ScDPObject& rDPObj, sal_uInt16 nListIdx );
234 explicit XclExpPTItem( sal_uInt16 nItemType, sal_uInt16 nCacheIdx );
270 sal_uInt16
GetItemIndex( std::u16string_view rName, sal_uInt16 nDefaultIdx )
const;
311 std::vector< XclPTDataFieldInfo >
336 sal_uInt16
GetDataFieldIndex(
const OUString& rName, sal_uInt16 nDefaultIdx )
const;
390 std::vector< XclPTDataFieldPos >
Represents a new group dimension whose dimension ID is higher than the highest source dimension ID.
const OUString & GetFieldName() const
Returns the name of this cache field.
XclExpPCItemList maOrigItemList
void InsertOrigDateTimeItem(const DateTime &rDateTime, const OUString &rText)
Inserts an original date/time item, if it is not contained already.
void WriteIndex(XclExpStream &rStrm, sal_uInt32 nSrcRow) const
Writes the item index at the passed source row position as part of the SXINDEXLIST record.
sal_uInt16 GetItemCount() const
Returns the number of visible items of this field.
void InitStdGroupField(const XclExpPCField &rBaseField, const ScDPSaveGroupDimension &rGroupDim)
Initializes a standard grouping field.
XclExpPCItemList maGroupItemList
List with original items.
void InsertOrigBoolItem(bool bValue, const OUString &rText)
Inserts an original boolean item, if it is not contained already.
XclExpPCItemList maNumGroupLimits
Indexes into maItemList.
void InitStandardField(const ScRange &rRange)
Initializes a standard field.
void InitDateGroupField(const ScDPObject &rDPObj, const ScDPNumGroupInfo &rDateInfo, sal_Int32 nDatePart)
Initializes a date grouping field.
XclExpPCField(const XclExpRoot &rRoot, sal_uInt16 nFieldIdx, const ScDPObject &rDPObj, const ScRange &rRange)
Creates a standard pivot cache field, filled from sheet source data.
void WriteSxgroupinfo(XclExpStream &rStrm)
Writes an SXGROUPINFO record describing the item order in grouping fields.
void InsertOrigItem(XclExpPCItem *pNewItem)
Inserts an original source item.
void InitNumGroupField(const ScDPObject &rDPObj, const ScDPNumGroupInfo &rNumInfo)
Initializes a numeric grouping field.
virtual ~XclExpPCField() override
XclExpRecordList< XclExpPCItem > XclExpPCItemList
void InsertOrigDoubleItem(double fValue, const OUString &rText)
Inserts an original value item, if it is not contained already.
sal_uInt16 mnTypeFlags
List with limit values for numeric grouping.
void WriteSxnumgroup(XclExpStream &rStrm)
Writes an SXNUMGROUP record and the additional items for a numeric grouping field.
std::size_t GetIndexSize() const
Returns the size an item index needs to write out.
virtual void Save(XclExpStream &rStrm) override
Writes the pivot cache field and all items and other related records.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the contents of the SXFIELD record for this field.
void InsertNumDateGroupItems(const ScDPObject &rDPObj, const ScDPNumGroupInfo &rNumInfo, sal_Int32 nDatePart=0)
Generates and inserts all visible items for numeric or date grouping.
void SetDateGroupLimit(const ScDPNumGroupInfo &rDateInfo, bool bUseStep)
Inserts the SXDATETIME/SXINTEGER items that specify the limits for a date grouping.
void SetGroupChildField(const XclExpPCField &rChildField)
Sets the passed field as direct grouping child field of this field.
void InsertItemArrayIndex(size_t nListPos)
Inserts the passed index into the item index array of original items.
sal_uInt16 InsertGroupItem(XclExpPCItem *pNewItem)
Inserts an item into the grouping item list.
void SetNumGroupLimit(const ScDPNumGroupInfo &rNumInfo)
Inserts the SXDOUBLE items that specify the limits for a numeric grouping.
sal_uInt16 GetItemIndex(std::u16string_view rItemName) const
Returns the index of a pivot cache item, or EXC_PC_NOITEM on error.
void Finalize()
Initializes flags and item count fields.
const XclExpPCItem * GetItem(sal_uInt16 nItemIdx) const
Returns the specified pivot cache item (returns visible items in groupings).
const XclExpPCItemList & GetVisItemList() const
Returns the item list that contains the visible items.
void InsertOrigTextItem(const OUString &rText)
Inserts an original text item, if it is not contained already.
ScfUInt16Vec maIndexVec
List with grouping items.
Represents a data item in a pivot cache containing data of any type.
sal_uInt16 GetTypeFlag() const
virtual void WriteBody(XclExpStream &rStrm) override
Writes the body of the record (without record header).
XclExpPCItem(const OUString &rText)
bool EqualsDouble(double fValue) const
bool EqualsDateTime(const DateTime &rDateTime) const
bool EqualsText(std::u16string_view rText) const
bool EqualsBool(bool bValue) const
XclPTFieldInfo maFieldInfo
The referred pivot cache field.
const XclExpPCField * mpCacheField
Parent pivot table containing this field.
void SetPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills this field with row/column/page properties from the passed save dimension.
sal_uInt16 GetLastDataInfoIndex() const
Returns the index of the last inserted data info struct.
const XclExpPivotTable & mrPTable
XclExpPTItem * GetItemAcc(std::u16string_view rName)
Returns an item by its name.
XclExpPTField(const XclExpPivotTable &rPTable, sal_uInt16 nCacheIdx)
void WriteSxdi(XclExpStream &rStrm, sal_uInt16 nDataInfoIdx) const
Writes an SXDI records containing info about a data field.
void AppendSubtotalItem(sal_uInt16 nItemType)
Appends a special item describing a field subtotal entry.
XclPTFieldExtInfo maFieldExtInfo
General field info (SXVD record).
XclPTPageFieldInfo maPageInfo
Extended field info (SXVDEX record).
XclExpRecordList< XclExpPTItem > maItemList
List of extended data field info (SXDI records).
void WriteSxvd(XclExpStream &rStrm) const
Writes the SXVD record introducing the field.
OUString GetFieldName() const
Returns the name of this field.
void SetDataPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills this field with data field properties from the passed save dimension.
std::vector< XclPTDataFieldInfo > maDataInfoVec
Page field info (entry in SXPI record).
void WriteSxvdex(XclExpStream &rStrm) const
Writes the SXVDEX record containing additional settings.
void WriteSxpiEntry(XclExpStream &rStrm) const
Writes an entry for an SXPI record containing own page field info.
void AppendSubtotalItems()
Appends special items describing the field subtotal entries.
virtual void Save(XclExpStream &rStrm) override
Writes the entire pivot table field.
sal_uInt16 GetFieldIndex() const
Returns the pivot table field list index of this field.
sal_uInt16 GetItemIndex(std::u16string_view rName, sal_uInt16 nDefaultIdx) const
Returns the list index of an item by its name.
XclExpPTItem(const XclExpPCField &rCacheField, sal_uInt16 nCacheIdx)
OUString GetItemName() const
Returns the internal name of this item.
const XclExpPCItem * mpCacheItem
XclPTItemInfo maItemInfo
The referred pivot cache item.
void SetPropertiesFromMember(const ScDPSaveMember &rSaveMem)
Fills this item with properties from the passed save member.
virtual void WriteBody(XclExpStream &rStrm) override
Writes the SXVI record body describing the pivot table item.
void AddGroupFields(const ScDPObject &rDPObj)
Adds all grouping pivot cache fields.
void WriteSxdb(XclExpStream &rStrm) const
Writes the SXDB record.
bool mbValid
List index in pivot cache buffer.
void WriteDconref(XclExpStream &rStrm) const
Writes the DCONREF record containing the source range.
void WriteCacheStream()
Creates the pivot cache storage stream and writes the cache.
sal_uInt16 GetCacheIndex() const
Returns the list index of the cache used in pivot table records.
bool HasEqualDataSource(const ScDPObject &rDPObj) const
Returns true, if the passed DP object has the same data source as this cache.
static void SaveXml(XclExpXmlStream &rStrm)
void AddStdFields(const ScDPObject &rDPObj)
Adds all standard pivot cache fields based on source data.
bool HasAddFields() const
Returns true, if this pivot cache contains non-standard fields (e.g.
void Save(XclExpStream &rStrm)
Writes related records into Workbook stream and creates the pivot cache storage stream.
void WriteSxindexlistList(XclExpStream &rStrm) const
Writes the SXINDEXLIST record list containing the item index table.
XclExpPivotCache(const XclExpRoot &rRoot, const ScDPObject &rDPObj, sal_uInt16 nListIdx)
XclExpPCFieldList::RecordRefType XclExpPCFieldRef
ScRange maDocSrcRange
The exported sheet source range.
OUString maTabName
List of all pivot cache fields.
OUString maSrcRangeName
Name of source data sheet.
const XclExpPCField * GetField(sal_uInt16 nFieldIdx) const
Returns the specified pivot cache field.
bool IsValid() const
Returns true, if the cache has been constructed successfully.
sal_uInt16 mnListIdx
The range used to build the cache fields and items.
bool HasItemIndexList() const
Returns true, if the item index list will be written.
sal_uInt16 GetFieldCount() const
Returns the number of pivot cache fields.
void AddFields(const ScDPObject &rDPObj)
Adds all pivot cache fields.
ScRange maExpSrcRange
The original sheet source range.
ScRange maOrigSrcRange
Range name for source data.
XclExpRecordList< XclExpPCField > XclExpPCFieldList
void WriteDConName(XclExpStream &rStrm) const
DCONNAME record contains range name source.
static void WriteSxdbex(XclExpStream &rStrm)
Writes the SXDBEX record.
XclExpPCFieldList maFieldList
Pivot cache settings (SXDB record).
The main class for pivot table export.
XclExpRecordRef CreatePivotCachesRecord()
Creates a record wrapper for exporting all pivot caches.
void CreatePivotTables()
Creates all pivot tables and caches from the Calc DataPilot objects.
XclExpRecordRef CreatePivotTablesRecord(SCTAB nScTab)
Creates a record wrapper for exporting all pivot tables of the specified sheet.
XclExpRecordList< XclExpPivotTable > XclExpPivotTableList
void WritePivotCaches(XclExpStream &rStrm)
Writes all pivot caches (all Workbook records and cache streams).
XclExpPivotTableList maPTableList
List of all pivot caches.
void WritePivotTables(XclExpStream &rStrm, SCTAB nScTab)
Writes all pivot tables of the specified Calc sheet.
const XclExpPivotCache * CreatePivotCache(const ScDPObject &rDPObj)
Finds an existing (if enabled in mbShareCaches) or creates a new pivot cache.
XclExpPivotTableList::RecordRefType XclExpPivotTableRef
XclExpPivotTableManager(const XclExpRoot &rRoot)
XclExpRecordList< XclExpPivotCache > maPCacheList
void WriteSxdiList(XclExpStream &rStrm) const
Writes all SXDI records containing info about the data fields.
const XclExpPTField * GetField(sal_uInt16 nFieldIdx) const
Returns a pivot table field by its name.
const XclExpPCField * GetCacheField(sal_uInt16 nCacheIdx) const
Returns a pivot cache field.
SCTAB GetScTab() const
Returns the output range of the pivot table.
void SetPropertiesFromDP(const ScDPSaveData &rSaveData)
Fills internal members with all properties from the passed save data.
std::vector< XclPTDataFieldPos > maDataFields
Page field indexes.
XclExpPTFieldList::RecordRefType XclExpPTFieldRef
SCTAB mnOutScTab
Special data field orientation field.
virtual void Save(XclExpStream &rStrm) override
Writes the entire pivot table.
void WriteSxview(XclExpStream &rStrm) const
Writes the SXVIEW record starting the pivot table.
bool mbValid
Sheet index of the output range.
ScfUInt16Vec maColFields
Row field indexes.
void WriteQsiSxTag(XclExpStream &rStrm) const
XclExpRecordList< XclExpPTField > XclExpPTFieldList
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.
void Finalize()
Initializes any data after processing the entire source DataPilot.
bool mbFilterBtn
true = The pivot table is valid for export.
void WriteSxViewEx9(XclExpStream &rStrm) const
Writes the SX_AUTOFORMAT records with the autoformat id and header layout.
static void WriteSxivd(XclExpStream &rStrm, const ScfUInt16Vec &rFields)
Writes an SXIVD record for row field or column field order.
XclPTInfo maPTInfo
The pivot cache this pivot table bases on.
ScfUInt16Vec maRowFields
All fields in pivot cache order.
const XclExpPivotCache & mrPCache
static void WriteSxli(XclExpStream &rStrm, sal_uInt16 nLineCount, sal_uInt16 nIndexCount)
Writes a dummy SXLI records containing item layout info.
XclExpPTField * GetFieldAcc(std::u16string_view rName)
Returns a pivot table field by its name.
XclExpPTFieldList maFieldList
The selected autoformat (SXVIEWEX9)
XclExpPivotTable(const XclExpRoot &rRoot, const ScDPObject &rDPObj, const XclExpPivotCache &rPCache)
void WriteSxex(XclExpStream &rStrm) const
Writes the SXEX records containing additional pivot table info.
XclExpPTField maDataOrientField
Data field indexes.
void SetFieldPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills a pivot table field with all properties from the passed save dimension.
void SetDataFieldPropertiesFromDim(const ScDPSaveDimension &rSaveDim)
Fills a pivot table data field with all properties from the passed save dimension.
ScfUInt16Vec maPageFields
Column field indexes.
XclPTExtInfo maPTExtInfo
Info about the pivot table (SXVIEW record).
void WriteSxpi(XclExpStream &rStrm) const
Writes the SXPI record containing page field info.
XclPTViewEx9Info maPTViewEx9Info
Extended info about the pivot table (SXEX record).
Base class for all Excel records.
Base class for single records with any content.
Access to global data from other classes.
This class is used to export Excel record streams.
Represents a field in a pivot cache.
XclPCFieldInfo maFieldInfo
Represents a data item of any type in a pivot cache.
Contains data for a pivot cache (SXDB record).
Extended information about a pivot table (SXEX record).
Contains extended data for a pivot table field (SXVDEX record).
Contains data for a pivot table field (SXVD record).
sal_uInt16 mnCacheIdx
Number of items of this field.
Contains data for a pivot table (SXVIEW record).
Contains data for a pivot table data item (SXVI record).
Contains data for a pivot table page field (part of SXPI record).
Pivot table autoformat settings (SXVIEWEX9 record).
rtl::Reference< XclExpPivotCache > XclExpPivotCacheRef
::std::pair< sal_uInt16, sal_uInt16 > XclPTDataFieldPos
Data field position specifying the pivot table field index (first) and data info index (second).