OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
OpenXLSX::XLSlicerBuilder Class Reference

#include <XLSlicerCollection.hpp>

Public Member Functions

 XLSlicerBuilder (XLWorksheet *worksheet, std::string cellRef, const XLTable *table, const XLPivotTable *pivot, std::string columnName)
 ~XLSlicerBuilder ()
 XLSlicerBuilder (const XLSlicerBuilder &)=delete
XLSlicerBuilder & operator= (const XLSlicerBuilder &)=delete
 XLSlicerBuilder (XLSlicerBuilder &&) noexcept
XLSlicerBuilder & operator= (XLSlicerBuilder &&)=delete
XLSlicerBuilder & name (std::string_view n)
 Override the slicer's internal unique name (defaults to columnName).
XLSlicerBuilder & caption (std::string_view c)
 Set the visible header caption (defaults to columnName).
XLSlicerBuilder & style (XLSlicerStyle s)
 Set style via strongly-typed enum.
XLSlicerBuilder & styleRaw (std::string_view rawName)
 Set style via raw Excel style string.
XLSlicerBuilder & size (uint32_t widthPx, uint32_t heightPx)
 Set size in pixels.
XLSlicerBuilder & showOnly (const std::vector< std::string > &items)
 Pre-select only these items (hide all others).
XLSlicerBuilder & columnCount (int cols)
 Set number of button columns in the slicer panel.
XLSlicerBuilder & sortDescending (bool desc=true)
 Sort items descending (Z→A). Default: ascending.
XLSlicerBuilder & lockedPosition (bool locked=true)
 Lock the slicer position so it can't be moved interactively.
XLSlicerBuilder & offset (int32_t dx, int32_t dy)
 Pixel offset from anchor cell (fine-grained positioning).
XLSlicer build ()
 operator XLSlicer ()
 Implicit conversion — allows: XLSlicer s = wks.slicers().add(...).caption("x");.

Constructor & Destructor Documentation

◆ XLSlicerBuilder() [1/3]

XLSlicerBuilder::XLSlicerBuilder ( XLWorksheet * worksheet,
std::string cellRef,
const XLTable * table,
const XLPivotTable * pivot,
std::string columnName )

◆ ~XLSlicerBuilder()

XLSlicerBuilder::~XLSlicerBuilder ( )

◆ XLSlicerBuilder() [2/3]

OpenXLSX::XLSlicerBuilder::XLSlicerBuilder ( const XLSlicerBuilder & )
delete

◆ XLSlicerBuilder() [3/3]

XLSlicerBuilder::XLSlicerBuilder ( XLSlicerBuilder && other)
noexcept

Member Function Documentation

◆ build()

XLSlicer XLSlicerBuilder::build ( )

Explicitly commit and return the resulting XLSlicer handle. After this call, destruction is a no-op.

◆ caption()

XLSlicerBuilder & XLSlicerBuilder::caption ( std::string_view c)

Set the visible header caption (defaults to columnName).

◆ columnCount()

XLSlicerBuilder & XLSlicerBuilder::columnCount ( int cols)

Set number of button columns in the slicer panel.

◆ lockedPosition()

XLSlicerBuilder & XLSlicerBuilder::lockedPosition ( bool locked = true)

Lock the slicer position so it can't be moved interactively.

◆ name()

XLSlicerBuilder & XLSlicerBuilder::name ( std::string_view n)

Override the slicer's internal unique name (defaults to columnName).

◆ offset()

XLSlicerBuilder & XLSlicerBuilder::offset ( int32_t dx,
int32_t dy )

Pixel offset from anchor cell (fine-grained positioning).

◆ operator XLSlicer()

XLSlicerBuilder::operator XLSlicer ( )

Implicit conversion — allows: XLSlicer s = wks.slicers().add(...).caption("x");.

◆ operator=() [1/2]

XLSlicerBuilder & OpenXLSX::XLSlicerBuilder::operator= ( const XLSlicerBuilder & )
delete

◆ operator=() [2/2]

XLSlicerBuilder & OpenXLSX::XLSlicerBuilder::operator= ( XLSlicerBuilder && )
delete

◆ showOnly()

XLSlicerBuilder & XLSlicerBuilder::showOnly ( const std::vector< std::string > & items)

Pre-select only these items (hide all others).

◆ size()

XLSlicerBuilder & XLSlicerBuilder::size ( uint32_t widthPx,
uint32_t heightPx )

Set size in pixels.

◆ sortDescending()

XLSlicerBuilder & XLSlicerBuilder::sortDescending ( bool desc = true)

Sort items descending (Z→A). Default: ascending.

◆ style()

XLSlicerBuilder & XLSlicerBuilder::style ( XLSlicerStyle s)

Set style via strongly-typed enum.

◆ styleRaw()

XLSlicerBuilder & XLSlicerBuilder::styleRaw ( std::string_view rawName)

Set style via raw Excel style string.


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