11#ifndef OPENXLSX_XLTABLES_HPP
12#define OPENXLSX_XLTABLES_HPP
22#include "OpenXLSX-Exports.hpp"
89 XLTable add(std::string_view name, std::string_view range);
107 mutable std::vector<XLTable> m_tables;
108 mutable bool m_loaded{
false};
169 std::string
name()
const;
375 void print(std::basic_ostream<char>& ostr)
const;
Definition XLAutoFilter.hpp:101
Represents a rectangular area of cells within a worksheet.
Definition XLCellRange.hpp:40
The XLTableCollection class manages multiple tables within a worksheet.
Definition XLTables.hpp:52
friend class XLWorksheet
Definition XLTables.hpp:53
size_t count() const
Get the number of tables in the collection.
Definition XLTables.cpp:60
XLTable table(std::string_view name) const
Get a table by its name.
Definition XLTables.cpp:70
bool valid() const
Check if the collection is valid.
Definition XLTables.cpp:164
XLTable operator[](size_t index) const
Get a table by its 0-based index.
Definition XLTables.cpp:65
XLTableCollection()=default
Constructor.
XLTable add(std::string_view name, std::string_view range)
Add a new table to the worksheet.
Definition XLTables.cpp:78
The XLTableColumn class encapsulates the <tableColumn> XML node. It allows setting different kinds of...
Definition XLTableColumn.hpp:31
The XLTable class represents a single Excel table (.xml file).
Definition XLTables.hpp:117
void setStyleName(std::string_view styleName)
Set the table style name.
Definition XLTables.cpp:249
std::string styleName() const
Get the table style name.
Definition XLTables.cpp:248
uint32_t headerRowDxfId() const
Get the differential formatting ID for the header row.
XLTableColumn appendColumn(std::string_view name)
Append a new column to the table.
Definition XLTables.cpp:305
void setShowLastColumn(bool show)
Set whether the last column is highlighted.
Definition XLTables.cpp:291
std::string displayName() const
Get the display name of the table.
Definition XLTables.cpp:217
void setShowHeaderRow(bool show)
Set whether the header row is shown.
Definition XLTables.cpp:324
void setName(std::string_view name)
Set the name of the table.
Definition XLTables.cpp:212
void setShowFirstColumn(bool show)
Set whether the first column is highlighted.
Definition XLTables.cpp:282
bool showFirstColumn() const
Check if the first column is highlighted.
Definition XLTables.cpp:280
friend class XLWorksheet
Definition XLTables.hpp:119
XLTable()
Constructor.
Definition XLTables.hpp:125
void setShowTotalsRow(bool show)
Set whether the totals row is shown.
Definition XLTables.cpp:331
void setHeaderRowDxfId(uint32_t id)
Set the differential formatting ID for the header row.
void setPublished(bool published)
Set whether the table is published.
Definition XLTables.cpp:260
uint32_t dataDxfId() const
Get the differential formatting ID for the data rows.
bool showTotalsRow() const
Check if the totals row is shown.
Definition XLTables.cpp:330
~XLTable()=default
The destructor.
void resizeToFitData(const XLWorksheet &worksheet)
Automatically resizes the table to fit the contiguous data in the worksheet.
Definition XLTables.cpp:379
XLTable(XLTable &&other) noexcept=default
Move constructor.
void setShowColumnStripes(bool show)
Set whether column stripes are shown.
Definition XLTables.cpp:273
XLTableColumn column(std::string_view name) const
Get a column by its name.
Definition XLTables.cpp:388
XLTable & operator=(const XLTable &)=default
Assignment operator.
XLTable & operator=(XLTable &&other) noexcept=default
Move assignment operator.
friend class XLTableCollection
Definition XLTables.hpp:118
bool showHeaderRow() const
Check if the header row is shown.
Definition XLTables.cpp:318
std::string name() const
Get the name of the table.
Definition XLTables.cpp:169
void setDataDxfId(uint32_t id)
Set the differential formatting ID for the data rows.
XLAutoFilter autoFilter() const
Get the auto filter object for the table.
Definition XLTables.cpp:298
bool showRowStripes() const
Check if row stripes are shown.
Definition XLTables.cpp:262
void setDisplayName(std::string_view name)
Set the display name of the table.
Definition XLTables.cpp:218
std::string rangeReference() const
Get the range reference of the table (e.g., "A1:C10").
Definition XLTables.cpp:224
void setShowRowStripes(bool show)
Set whether row stripes are shown.
Definition XLTables.cpp:264
uint32_t id() const
Get the name of the table.
Definition XLTables.cpp:167
bool showColumnStripes() const
Check if column stripes are shown.
Definition XLTables.cpp:271
bool published() const
Check if the table is published.
Definition XLTables.cpp:259
bool showLastColumn() const
Check if the last column is highlighted.
Definition XLTables.cpp:289
void createColumnsFromRange(const XLWorksheet &worksheet)
Automatically initializes the columns of the table from the header row of the specified worksheet ran...
Definition XLTables.cpp:358
void setComment(std::string_view comment)
Set the table comment.
Definition XLTables.cpp:257
void print(std::basic_ostream< char > &ostr) const
Print the XML contents of this XLTable instance using the underlying XMLNode print function.
Definition XLTables.cpp:404
std::string comment() const
Get the table comment.
Definition XLTables.cpp:256
void setRangeReference(std::string_view ref)
Set the range reference of the table.
Definition XLTables.cpp:225
XLTable(const XLTable &other)=default
The copy constructor.
A class encapsulating an Excel worksheet. Access to XLWorksheet objects should be via the workbook ob...
Definition XLWorksheet.hpp:132
The XLXmlData class encapsulates the properties and behaviour of the .xml files in an ....
Definition XLXmlData.hpp:79
XLXmlFile()=default
Default constructor.
Definition IXLCellProvider.hpp:24
OpenXLSX_xml_node XMLNode
Definition XLXmlParser.hpp:64
XLTableCollection XLTables
Definition XLTables.hpp:379
Definition XLTables.hpp:35
std::string slicerStyle
Definition XLTables.hpp:42
uint32_t width
Definition XLTables.hpp:38
int32_t offsetX
Definition XLTables.hpp:40
std::vector< std::string > selectedItems
Definition XLTables.hpp:43
uint32_t height
Definition XLTables.hpp:39
std::string caption
Definition XLTables.hpp:37
int32_t offsetY
Definition XLTables.hpp:41
std::string name
Definition XLTables.hpp:36