OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
XLTableColumn.hpp
Go to the documentation of this file.
1/*
2 * OpenXLSX-NX - Modern High-Performance C++ Excel Library
3 *
4 * Original work Copyright (c) 2018-2025, Kenneth Troldal Balslev and OpenXLSX contributors
5 * Modified work Copyright (c) 2026, Curry Tang and OpenXLSX-NX contributors
6 *
7 * Distributed under the BSD 3-Clause License.
8 * See LICENSE.md in the project root or https://opensource.org/licenses/BSD-3-Clause
9 */
10
11#pragma once
12
13#include "XLXmlParser.hpp"
14#include <optional>
15#include <string>
16#include <string_view>
17
18namespace OpenXLSX
19{
20
25
31 {
32 public:
37 explicit XLTableColumn(XMLNode node);
38
43 operator bool() const;
44
49 uint32_t id() const;
50
55 std::string name() const;
56
61 void setName(std::string_view name);
62
68
74
79 std::string totalsRowLabel() const;
80
85 void setTotalsRowLabel(std::string_view label);
86
91 std::string calculatedColumnFormula() const;
92
97 void setCalculatedColumnFormula(std::string_view formula);
98
103 std::string totalsRowFormula() const;
104
109 void setTotalsRowFormula(std::string_view formula);
110
111 private:
112 XMLNode m_node;
113 };
114
115} // namespace OpenXLSX
XLTableColumn(XMLNode node)
Constructor.
Definition XLTableColumn.cpp:19
void setCalculatedColumnFormula(std::string_view formula)
Set the calculated column formula.
Definition XLTableColumn.cpp:96
XLTotalsRowFunction totalsRowFunction() const
Get the totals row function for this column.
Definition XLTableColumn.cpp:27
void setTotalsRowFunction(XLTotalsRowFunction func)
Set the totals row function for this column.
Definition XLTableColumn.cpp:38
void setTotalsRowFormula(std::string_view formula)
Set a custom totals row formula.
Definition XLTableColumn.cpp:83
void setName(std::string_view name)
Set the name of the table column.
Definition XLTableColumn.cpp:25
uint32_t id() const
Get the ID of the table column.
Definition XLTableColumn.cpp:23
std::string totalsRowFormula() const
Get the custom totals row formula.
Definition XLTableColumn.cpp:77
std::string totalsRowLabel() const
Get the totals row label for this column.
Definition XLTableColumn.cpp:66
std::string calculatedColumnFormula() const
Get the calculated column formula.
Definition XLTableColumn.cpp:95
void setTotalsRowLabel(std::string_view label)
Set the totals row label for this column.
Definition XLTableColumn.cpp:67
std::string name() const
Get the name of the table column.
Definition XLTableColumn.cpp:24
Definition XLFormulaUtils.hpp:37
Definition IXLCellProvider.hpp:24
XLTotalsRowFunction
Enum class defining the possible functions for a table's totals row.
Definition XLTableColumn.hpp:24
@ None
Definition XLChart.hpp:72
@ CountNums
Definition XLPivotTable.hpp:23
@ StdDev
Definition XLPivotTable.hpp:23
@ Var
Definition XLPivotTable.hpp:23
@ Sum
Definition XLPivotTable.hpp:23
@ Average
Definition XLPivotTable.hpp:23
@ Count
Definition XLPivotTable.hpp:23
OpenXLSX_xml_node XMLNode
Definition XLXmlParser.hpp:64
@ Custom
Definition XLChart.hpp:112
@ Max
Definition XLChart.hpp:118
@ Min
Definition XLChart.hpp:118