OpenXLSX 1.9.1
Loading...
Searching...
No Matches
OpenXLSX::XLTableColumn Class Reference

The XLTableColumn class encapsulates the <tableColumn> XML node. It allows setting different kinds of column properties in a table. More...

#include <XLTableColumn.hpp>

Public Member Functions

 XLTableColumn (XMLNode node)
 Constructor.
 
 operator bool () const
 Check if the TableColumn object is valid (has a corresponding XML node).
 
uint32_t id () const
 Get the ID of the table column.
 
std::string name () const
 Get the name of the table column.
 
void setName (std::string_view name)
 Set the name of the table column.
 
XLTotalsRowFunction totalsRowFunction () const
 Get the totals row function for this column.
 
void setTotalsRowFunction (XLTotalsRowFunction func)
 Set the totals row function for this column.
 
std::string totalsRowLabel () const
 Get the totals row label for this column.
 
void setTotalsRowLabel (std::string_view label)
 Set the totals row label for this column.
 
std::string calculatedColumnFormula () const
 Get the calculated column formula.
 
void setCalculatedColumnFormula (std::string_view formula)
 Set the calculated column formula.
 
std::string totalsRowFormula () const
 Get the custom totals row formula.
 
void setTotalsRowFormula (std::string_view formula)
 Set a custom totals row formula.
 

Detailed Description

The XLTableColumn class encapsulates the <tableColumn> XML node. It allows setting different kinds of column properties in a table.

Constructor & Destructor Documentation

◆ XLTableColumn()

OpenXLSX::XLTableColumn::XLTableColumn ( XMLNode  node)
explicit

Constructor.

Parameters
nodeThe <tableColumn> XMLNode

Member Function Documentation

◆ calculatedColumnFormula()

std::string OpenXLSX::XLTableColumn::calculatedColumnFormula ( ) const

Get the calculated column formula.

Returns
The formula string, or an empty string if not set.

◆ id()

uint32_t OpenXLSX::XLTableColumn::id ( ) const

Get the ID of the table column.

Returns
The column ID.

◆ name()

std::string OpenXLSX::XLTableColumn::name ( ) const

Get the name of the table column.

Returns
The column name.

◆ operator bool()

OpenXLSX::XLTableColumn::operator bool ( ) const

Check if the TableColumn object is valid (has a corresponding XML node).

Returns
true if valid, false otherwise.

◆ setCalculatedColumnFormula()

void OpenXLSX::XLTableColumn::setCalculatedColumnFormula ( std::string_view  formula)

Set the calculated column formula.

Parameters
formulaThe formula string (e.g., "[@Price]*[@Quantity]").

◆ setName()

void OpenXLSX::XLTableColumn::setName ( std::string_view  name)

Set the name of the table column.

Parameters
nameThe new name of the column.

◆ setTotalsRowFormula()

void OpenXLSX::XLTableColumn::setTotalsRowFormula ( std::string_view  formula)

Set a custom totals row formula.

Parameters
formulaThe formula string.

◆ setTotalsRowFunction()

void OpenXLSX::XLTableColumn::setTotalsRowFunction ( XLTotalsRowFunction  func)

Set the totals row function for this column.

Parameters
funcThe XLTotalsRowFunction to set.

◆ setTotalsRowLabel()

void OpenXLSX::XLTableColumn::setTotalsRowLabel ( std::string_view  label)

Set the totals row label for this column.

Parameters
labelThe string to set as label.

◆ totalsRowFormula()

std::string OpenXLSX::XLTableColumn::totalsRowFormula ( ) const

Get the custom totals row formula.

Returns
The formula string, or an empty string if not set.

◆ totalsRowFunction()

XLTotalsRowFunction OpenXLSX::XLTableColumn::totalsRowFunction ( ) const

Get the totals row function for this column.

Returns
The XLTotalsRowFunction.

◆ totalsRowLabel()

std::string OpenXLSX::XLTableColumn::totalsRowLabel ( ) const

Get the totals row label for this column.

Returns
The custom string label.

The documentation for this class was generated from the following files: