1#ifndef OPENXLSX_XLPIVOTTABLE_HPP
2#define OPENXLSX_XLPIVOTTABLE_HPP
4#include "OpenXLSX-Exports.hpp"
32 : m_name(
std::move(name)), m_sourceRange(
std::move(sourceRange)), m_targetCell(
std::move(targetCell)) {}
37 m_rows.push_back({std::move(fieldName), XLPivotSubtotal::Sum,
"", 0});
42 m_columns.push_back({std::move(fieldName), XLPivotSubtotal::Sum,
"", 0});
47 m_data.push_back({std::move(fieldName), subtotal, std::move(customName), numFmtId});
52 m_filters.push_back({std::move(fieldName), XLPivotSubtotal::Sum,
"", 0});
73 [[nodiscard]]
const std::string&
name()
const {
return m_name; }
74 [[nodiscard]]
const std::string&
sourceRange()
const {
return m_sourceRange; }
75 [[nodiscard]]
const std::string&
targetCell()
const {
return m_targetCell; }
76 [[nodiscard]]
const std::vector<XLPivotField>&
rows()
const {
return m_rows; }
77 [[nodiscard]]
const std::vector<XLPivotField>&
columns()
const {
return m_columns; }
78 [[nodiscard]]
const std::vector<XLPivotField>&
data()
const {
return m_data; }
79 [[nodiscard]]
const std::vector<XLPivotField>&
filters()
const {
return m_filters; }
82 [[nodiscard]]
bool dataOnRows()
const {
return m_dataOnRows; }
85 [[nodiscard]]
bool showDrill()
const {
return m_showDrill; }
88 [[nodiscard]]
bool mergeItem()
const {
return m_mergeItem; }
89 [[nodiscard]]
bool compactData()
const {
return m_compactData; }
90 [[nodiscard]]
bool showError()
const {
return m_showError; }
99 std::string m_sourceRange;
100 std::string m_targetCell;
102 std::vector<XLPivotField> m_rows;
103 std::vector<XLPivotField> m_columns;
104 std::vector<XLPivotField> m_data;
105 std::vector<XLPivotField> m_filters;
107 bool m_dataOnRows {
false};
108 bool m_rowGrandTotals {
true};
109 bool m_colGrandTotals {
true};
110 bool m_showDrill {
true};
111 bool m_useAutoFormatting {
false};
112 bool m_pageOverThenDown {
false};
113 bool m_mergeItem {
false};
114 bool m_compactData {
true};
115 bool m_showError {
false};
116 bool m_showRowHeaders {
true};
117 bool m_showColHeaders {
true};
118 bool m_showRowStripes {
false};
119 bool m_showColStripes {
false};
120 bool m_showLastColumn {
false};
122 std::string m_pivotTableStyleName{
"PivotStyleLight16"};
138 void setName(std::string_view name);
143 void setRefreshOnLoad(
bool refresh =
true);
148 std::string name()
const;
153 std::string targetCell()
const;
158 std::string sourceRange()
const;
169 void changeSourceRange(std::string_view newRange);
188 std::string sourceRange()
const;
194 void changeSourceRange(std::string_view newRange);
XLXmlData * xmlData
Definition XLDocument.cpp:1422
Definition XLPivotTable.hpp:173
~XLPivotCacheDefinition()=default
XLPivotCacheDefinition(XLPivotCacheDefinition &&other) noexcept=default
XLPivotCacheDefinition()
Definition XLPivotTable.hpp:177
XLPivotCacheDefinition & operator=(const XLPivotCacheDefinition &other)=default
XLPivotCacheDefinition & operator=(XLPivotCacheDefinition &&other) noexcept=default
XLPivotCacheDefinition(const XLPivotCacheDefinition &other)=default
Definition XLPivotTable.hpp:198
XLPivotCacheRecords & operator=(const XLPivotCacheRecords &other)=default
~XLPivotCacheRecords()=default
XLPivotCacheRecords()
Definition XLPivotTable.hpp:200
XLPivotCacheRecords & operator=(XLPivotCacheRecords &&other) noexcept=default
XLPivotCacheRecords(const XLPivotCacheRecords &other)=default
XLPivotCacheRecords(XLPivotCacheRecords &&other) noexcept=default
Definition XLPivotTable.hpp:23
bool dataOnRows() const
Definition XLPivotTable.hpp:82
XLPivotTableOptions & setShowRowStripes(bool value)
Definition XLPivotTable.hpp:68
XLPivotTableOptions & setRowGrandTotals(bool value)
Definition XLPivotTable.hpp:58
bool showColStripes() const
Definition XLPivotTable.hpp:94
const std::string & targetCell() const
Definition XLPivotTable.hpp:75
XLPivotTableOptions & setUseAutoFormatting(bool value)
Definition XLPivotTable.hpp:61
XLPivotTableOptions & addDataField(std::string fieldName, std::string customName="", XLPivotSubtotal subtotal=XLPivotSubtotal::Sum, uint32_t numFmtId=0)
Definition XLPivotTable.hpp:46
bool useAutoFormatting() const
Definition XLPivotTable.hpp:86
XLPivotTableOptions & setColGrandTotals(bool value)
Definition XLPivotTable.hpp:59
bool showRowHeaders() const
Definition XLPivotTable.hpp:91
const std::string & pivotTableStyleName() const
Definition XLPivotTable.hpp:80
XLPivotTableOptions & setShowLastColumn(bool value)
Definition XLPivotTable.hpp:70
const std::string & name() const
Definition XLPivotTable.hpp:73
bool showDrill() const
Definition XLPivotTable.hpp:85
XLPivotTableOptions & setCompactData(bool value)
Definition XLPivotTable.hpp:64
const std::vector< XLPivotField > & columns() const
Definition XLPivotTable.hpp:77
bool showLastColumn() const
Definition XLPivotTable.hpp:95
const std::string & sourceRange() const
Definition XLPivotTable.hpp:74
XLPivotTableOptions & setPageOverThenDown(bool value)
Definition XLPivotTable.hpp:62
XLPivotTableOptions & setMergeItem(bool value)
Definition XLPivotTable.hpp:63
bool compactData() const
Definition XLPivotTable.hpp:89
const std::vector< XLPivotField > & data() const
Definition XLPivotTable.hpp:78
XLPivotTableOptions & setShowRowHeaders(bool value)
Definition XLPivotTable.hpp:66
XLPivotTableOptions & addFilterField(std::string fieldName)
Definition XLPivotTable.hpp:51
bool pageOverThenDown() const
Definition XLPivotTable.hpp:87
bool showColHeaders() const
Definition XLPivotTable.hpp:92
XLPivotTableOptions & setShowColHeaders(bool value)
Definition XLPivotTable.hpp:67
XLPivotTableOptions & setShowError(bool value)
Definition XLPivotTable.hpp:65
const std::vector< XLPivotField > & filters() const
Definition XLPivotTable.hpp:79
XLPivotTableOptions & setShowColStripes(bool value)
Definition XLPivotTable.hpp:69
XLPivotTableOptions & setShowDrill(bool value)
Definition XLPivotTable.hpp:60
XLPivotTableOptions & setDataOnRows(bool value)
Definition XLPivotTable.hpp:57
XLPivotTableOptions & setPivotTableStyle(std::string styleName)
Definition XLPivotTable.hpp:56
bool showError() const
Definition XLPivotTable.hpp:90
XLPivotTableOptions & addRowField(std::string fieldName)
Definition XLPivotTable.hpp:36
XLPivotTableOptions & addColumnField(std::string fieldName)
Definition XLPivotTable.hpp:41
XLPivotTableOptions(std::string name, std::string sourceRange, std::string targetCell)
Construct fully initialized Pivot Table options.
Definition XLPivotTable.hpp:31
bool rowGrandTotals() const
Definition XLPivotTable.hpp:83
bool showRowStripes() const
Definition XLPivotTable.hpp:93
bool colGrandTotals() const
Definition XLPivotTable.hpp:84
bool mergeItem() const
Definition XLPivotTable.hpp:88
const std::vector< XLPivotField > & rows() const
Definition XLPivotTable.hpp:76
Definition XLPivotTable.hpp:126
XLPivotTable()
Definition XLPivotTable.hpp:130
XLPivotTable(const XLPivotTable &other)=default
XLPivotTable(XLPivotTable &&other) noexcept=default
XLPivotTable & operator=(const XLPivotTable &other)=default
XLPivotTable & operator=(XLPivotTable &&other) noexcept=default
Definition XLRelationships.hpp:140
The XLXmlData class encapsulates the properties and behaviour of the .xml files in an ....
Definition XLXmlData.hpp:29
The XLXmlFile class provides an interface for derived classes to use. It functions as an ancestor to ...
Definition XLXmlFile.hpp:42
Definition IZipArchive.hpp:18
XLPivotSubtotal
Definition XLPivotTable.hpp:12
Definition XLCellIterator.hpp:121
Definition XLPivotTable.hpp:15
std::string customName
Definition XLPivotTable.hpp:18
std::string name
Definition XLPivotTable.hpp:16
XLPivotSubtotal subtotal
Definition XLPivotTable.hpp:17
uint32_t numFmtId
Definition XLPivotTable.hpp:19