|
OpenXLSX 1.9.1
|
A class encapsulating an Excel worksheet. Access to XLWorksheet objects should be via the workbook object. More...
#include <XLWorksheet.hpp>
Public Member Functions | |
| XLWorksheet () | |
| XLWorksheet (XLXmlData *xmlData) | |
| ~XLWorksheet () | |
| XLWorksheet (const XLWorksheet &other) | |
| XLWorksheet (XLWorksheet &&other) noexcept | |
| XLWorksheet & | operator= (const XLWorksheet &other) |
| XLWorksheet & | operator= (XLWorksheet &&other) |
| XLCellAssignable | cell (const std::string &ref) const |
| XLCellAssignable | cell (const XLCellReference &ref) const |
| XLCellAssignable | cell (uint32_t rowNumber, uint16_t columnNumber) const |
| XLCellAssignable | cell (XLRowIndex row, XLColIndex col) const |
| XLStreamWriter | streamWriter () |
| Starts a high-performance, low-memory stream writer for this worksheet. | |
| XLStreamReader | streamReader () const |
| Create a stream reader for memory efficient reading of large documents. | |
| XLCellAssignable | findCell (const std::string &ref) const |
| XLCellAssignable | findCell (const XLCellReference &ref) const |
| XLCellAssignable | findCell (uint32_t rowNumber, uint16_t columnNumber) const |
| std::optional< XLCell > | peekCell (const std::string &ref) const |
| std::optional< XLCell > | peekCell (const XLCellReference &ref) const |
| std::optional< XLCell > | peekCell (uint32_t rowNumber, uint16_t columnNumber) const |
| std::optional< XLCell > | peekCell (XLRowIndex row, XLColIndex col) const |
| XLCellRange | range () const |
| XLCellRange | range (const XLCellReference &topLeft, const XLCellReference &bottomRight) const |
| XLCellRange | range (std::string const &topLeft, std::string const &bottomRight) const |
| XLCellRange | range (std::string const &rangeReference) const |
| XLRowRange | rows () const |
| XLRowRange | rows (uint32_t rowCount) const |
| XLRowRange | rows (uint32_t firstRow, uint32_t lastRow) const |
| XLRow | row (uint32_t rowNumber) const |
| void | appendRow (const std::vector< XLCellValue > &values) |
| Append a new row with the given values. | |
| template<typename T , typename = std::enable_if_t<!std::is_same_v<T, std::vector<XLCellValue>> && std::is_base_of_v<std::bidirectional_iterator_tag, typename std::iterator_traits<typename T::iterator>::iterator_category>, T>> | |
| void | appendRow (const T &values) |
| Append a new row with the given container of values. | |
| XLColumn | column (uint16_t columnNumber) const |
| XLColumn | column (std::string const &columnRef) const |
| void | autoFitColumn (uint16_t columnNumber) |
| Automatically adjusts the column width based on the content of its cells. | |
| void | groupRows (uint32_t rowFirst, uint32_t rowLast, uint8_t outlineLevel=1, bool collapsed=false) |
| void | groupColumns (uint16_t colFirst, uint16_t colLast, uint8_t outlineLevel=1, bool collapsed=false) |
| void | setAutoFilter (const XLCellRange &range) |
| void | clearAutoFilter () |
| bool | hasAutoFilter () const |
| std::string | autoFilter () const |
| XLAutoFilter | autofilterObject () const |
| void | addSortCondition (const std::string &ref, uint16_t colId, bool descending=false) |
| Set the sort state for the worksheet. | |
| void | applyAutoFilter () |
| Evaluates the current autoFilter conditions and hides rows that do not match the criteria. Note: Only basic text/value matching and some simple custom filters are evaluated. Complex dynamic filters might not be supported. | |
| XLCellReference | lastCell () const noexcept |
| uint16_t | columnCount () const noexcept |
| uint32_t | rowCount () const noexcept |
| bool | deleteRow (uint32_t rowNumber) |
| bool | insertRow (uint32_t rowNumber, uint32_t count=1) |
| Insert one or more empty rows before the given row number. | |
| bool | deleteRow (uint32_t rowNumber, uint32_t count) |
| Delete one or more rows and shift subsequent rows up. | |
| bool | insertColumn (uint16_t colNumber, uint16_t count=1) |
| Insert one or more empty columns before the given column number. | |
| bool | deleteColumn (uint16_t colNumber, uint16_t count=1) |
| Delete one or more columns and shift subsequent columns left. | |
| void | updateSheetName (const std::string &oldName, const std::string &newName) |
| void | updateDimension () |
| XLMergeCells & | merges () |
| XLDataValidations & | dataValidations () |
| XLCellRange | mergeCells (XLCellRange const &rangeToMerge, bool emptyHiddenCells=false) |
| XLCellRange | mergeCells (const std::string &rangeReference, bool emptyHiddenCells=false) |
| void | unmergeCells (XLCellRange const &rangeToMerge) |
| void | unmergeCells (const std::string &rangeReference) |
| XLStyleIndex | getColumnFormat (uint16_t column) const |
| XLStyleIndex | getColumnFormat (const std::string &column) const |
| bool | setColumnFormat (uint16_t column, XLStyleIndex cellFormatIndex) |
| bool | setColumnFormat (const std::string &column, XLStyleIndex cellFormatIndex) |
| XLStyleIndex | getRowFormat (uint16_t row) const |
| bool | setRowFormat (uint32_t row, XLStyleIndex cellFormatIndex) |
| XLConditionalFormats | conditionalFormats () const |
| void | addConditionalFormatting (const std::string &sqref, const XLCfRule &rule) |
| void | addConditionalFormatting (const std::string &sqref, const XLCfRule &rule, const XLDxf &dxf) |
| void | addConditionalFormatting (const XLCellRange &range, const XLCfRule &rule) |
| void | addConditionalFormatting (const XLCellRange &range, const XLCfRule &rule, const XLDxf &dxf) |
| void | removeConditionalFormatting (const std::string &sqref) |
| void | removeConditionalFormatting (const XLCellRange &range) |
| void | clearAllConditionalFormatting () |
| XLPageMargins | pageMargins () const |
| XLPrintOptions | printOptions () const |
| XLPageSetup | pageSetup () const |
| XLHeaderFooter | headerFooter () const |
| void | setPrintArea (const std::string &sqref) |
| Set the print area for this worksheet. | |
| void | setPrintTitleRows (uint32_t firstRow, uint32_t lastRow) |
| Set rows to repeat at the top of each printed page. | |
| void | setPrintTitleCols (uint16_t firstCol, uint16_t lastCol) |
| Set columns to repeat at the left of each printed page. | |
| bool | protect (const XLSheetProtectionOptions &options, std::string_view password="") |
| Protect the worksheet with granular options. | |
| bool | protectSheet (bool set=true) |
| bool | protectObjects (bool set=true) |
| bool | protectScenarios (bool set=true) |
| bool | allowInsertColumns (bool set=true) |
| bool | allowInsertRows (bool set=true) |
| bool | allowDeleteColumns (bool set=true) |
| bool | allowDeleteRows (bool set=true) |
| bool | allowFormatCells (bool set=true) |
| bool | allowFormatColumns (bool set=true) |
| bool | allowFormatRows (bool set=true) |
| bool | allowInsertHyperlinks (bool set=true) |
| bool | allowSort (bool set=true) |
| bool | allowAutoFilter (bool set=true) |
| bool | allowPivotTables (bool set=true) |
| bool | allowSelectLockedCells (bool set=true) |
| bool | allowSelectUnlockedCells (bool set=true) |
| bool | denyInsertColumns () |
| bool | denyInsertRows () |
| bool | denyDeleteColumns () |
| bool | denyDeleteRows () |
| bool | denyFormatCells () |
| bool | denyFormatColumns () |
| bool | denyFormatRows () |
| bool | denyInsertHyperlinks () |
| bool | denySort () |
| bool | denyAutoFilter () |
| bool | denyPivotTables () |
| bool | denySelectLockedCells () |
| bool | denySelectUnlockedCells () |
| bool | setPasswordHash (std::string hash) |
| bool | setPassword (std::string password) |
| bool | clearPassword () |
| bool | clearSheetProtection () |
| bool | sheetProtected () const |
| bool | objectsProtected () const |
| bool | scenariosProtected () const |
| bool | insertColumnsAllowed () const |
| bool | insertRowsAllowed () const |
| bool | deleteColumnsAllowed () const |
| bool | deleteRowsAllowed () const |
| bool | formatCellsAllowed () const |
| bool | formatColumnsAllowed () const |
| bool | formatRowsAllowed () const |
| bool | insertHyperlinksAllowed () const |
| bool | sortAllowed () const |
| bool | autoFilterAllowed () const |
| bool | pivotTablesAllowed () const |
| bool | selectLockedCellsAllowed () const |
| bool | selectUnlockedCellsAllowed () const |
| std::string | passwordHash () const |
| bool | passwordIsSet () const |
| std::string | sheetProtectionSummary () const |
| void | addSparkline (const std::string &location, const std::string &dataRange, XLSparklineType type=XLSparklineType::Line) |
| Add a sparkline to the worksheet. | |
| void | addSparkline (const std::string &location, const std::string &dataRange, const XLSparklineOptions &options) |
| Add a sparkline graph with advanced configuration options. | |
| bool | hasRelationships () const |
| bool | hasDrawing () const |
| bool | hasVmlDrawing () const |
| bool | hasComments () const |
| bool | hasThreadedComments () const |
| bool | hasTables () const |
| XLDrawing & | drawing () |
| void | addImage (const std::string &name, const std::string &data, uint32_t row, uint32_t col, uint32_t width, uint32_t height, const XLImageOptions &options=XLImageOptions()) |
| void | addShape (std::string_view cellReference, const XLVectorShapeOptions &options) |
| Insert an image at the specified cell with original dimensions (automatic parsing). | |
| void | addTableSlicer (std::string_view cellReference, const XLTable &table, std::string_view columnName, const XLSlicerOptions &options=XLSlicerOptions()) |
| Add a slicer connected to a table. | |
| void | addPivotSlicer (std::string_view cellReference, const XLPivotTable &pivotTable, std::string_view columnName, const XLSlicerOptions &options=XLSlicerOptions()) |
| Add a slicer connected to a Pivot Table. | |
| void | insertImage (const std::string &cellReference, const std::string &imagePath) |
| void | insertImage (const std::string &cellReference, const std::string &imagePath, const XLImageOptions &options) |
| Insert an image with advanced formatting options (scaling, offset, behavior). | |
| void | addScaledImage (const std::string &name, const std::string &data, uint32_t row, uint32_t col, double scalingFactor=1.0) |
| std::vector< XLDrawingItem > | images () |
| XLChart | addChart (XLChartType type, std::string_view name, uint32_t row, uint32_t col, uint32_t width, uint32_t height) |
| XLChart | addChart (XLChartType type, const XLChartAnchor &anchor) |
| std::vector< XLPivotTable > | pivotTables () |
| Retrieves all pivot tables belonging to this worksheet. | |
| XLPivotTable | addPivotTable (const XLPivotTableOptions &options) |
| Create and add a pivot table to this worksheet. | |
| bool | deletePivotTable (std::string_view name) |
| Delete a pivot table by name from this worksheet. | |
| XLVmlDrawing & | vmlDrawing () |
| XLComments & | comments () |
| XLThreadedComments & | threadedComments () |
| void | addNote (std::string_view cellRef, std::string_view text, std::string_view author="") |
| Add a comment to a cell seamlessly. | |
| void | deleteComment (std::string_view cellRef) |
| Remove a modern threaded comment (and its replies) from a cell. | |
| void | deleteNote (std::string_view cellRef) |
| Remove a legacy yellow note from a cell. | |
| XLThreadedComment | addComment (std::string_view cellRef, std::string_view text, std::string_view author="") |
| Add a modern threaded comment to a cell seamlessly. | |
| XLThreadedComment | addReply (const std::string &parentId, const std::string &text, const std::string &author="") |
| Add a reply to an existing threaded comment. | |
| XLTableCollection & | tables () |
| void | addHyperlink (std::string_view cellRef, std::string_view url, std::string_view tooltip="") |
| void | addInternalHyperlink (std::string_view cellRef, std::string_view location, std::string_view tooltip="") |
| bool | hasHyperlink (std::string_view cellRef) const |
| std::string | getHyperlink (std::string_view cellRef) const |
| void | removeHyperlink (std::string_view cellRef) |
| bool | hasPanes () const |
| void | freezePanes (uint16_t column, uint32_t row) |
| void | freezePanes (const std::string &topLeftCell) |
| Freeze panes at the specified top-left cell. This is a highly ergonomic method. E.g. freezePanes("B2") freezes Row 1 and Column A. | |
| void | splitPanes (double xSplit, double ySplit, std::string_view topLeftCell="", XLPane activePane=XLPane::BottomRight) |
| void | clearPanes () |
| void | setZoom (uint16_t scale) |
| uint16_t | zoom () const |
| void | insertRowBreak (uint32_t row) |
| void | insertColBreak (uint16_t col) |
| void | removeRowBreak (uint32_t row) |
| void | removeColBreak (uint16_t col) |
| void | setSheetViewMode (std::string_view mode) |
| std::string | sheetViewMode () const |
| void | setShowGridLines (bool show) |
| bool | showGridLines () const |
| void | setShowRowColHeaders (bool show) |
| bool | showRowColHeaders () const |
| void | fitToPages (uint32_t fitToWidth, uint32_t fitToHeight) |
Public Member Functions inherited from OpenXLSX::XLSheetBase< XLWorksheet > | |
| XLSheetBase () | |
| Constructor. | |
| XLSheetBase (XLXmlData *xmlData) | |
| The constructor. There are no default constructor, so all parameters must be provided for constructing an XLAbstractSheet object. Since this is a pure abstract class, instantiation is only possible via one of the derived classes. | |
| XLSheetBase (const XLSheetBase &other)=default | |
| The copy constructor. | |
| XLSheetBase (XLSheetBase &&other) noexcept=default | |
| ~XLSheetBase ()=default | |
| The destructor. | |
| XLSheetBase & | operator= (const XLSheetBase &)=default |
| Assignment operator. | |
| XLSheetBase & | operator= (XLSheetBase &&other) noexcept=default |
| XLSheetState | visibility () const |
| void | setVisibility (XLSheetState state) |
| XLColor | color () const |
| void | setColor (const XLColor &color) |
| uint16_t | index () const |
| look up sheet name via relationshipID, then attempt to match that to a sheet in XLWorkbook::sheet(uint16_t index), looping over index | |
| void | setIndex (uint16_t index) |
| std::string | name () const |
| Method to retrieve the name of the sheet. | |
| void | setName (const std::string &sheetName) |
| Method for renaming the sheet. | |
| bool | isSelected () const |
| void | setSelected (bool selected) |
| bool | isActive () const |
| bool | setActive () |
| void | clone (const std::string &newName) |
| Method for cloning the sheet. | |
Public Member Functions inherited from OpenXLSX::XLXmlFile | |
| XLXmlFile ()=default | |
| Default constructor. | |
| std::string | xmlData (XLXmlSavingDeclaration savingDeclaration=XLXmlSavingDeclaration{}) const |
| Method for getting the XML data represented by the object. | |
| XLXmlFile (XLXmlData *xmlData) | |
| Constructor. Creates an object based on the xmlData input. | |
| XLXmlFile (const XLXmlFile &other)=default | |
| Copy constructor. Default implementation used. | |
| XLXmlFile (XLXmlFile &&other) noexcept=default | |
| Move constructor. Default implementation used. | |
| ~XLXmlFile ()=default | |
| Destructor. Default implementation used. | |
| bool | valid () const |
| check whether class is linked to a valid XML file | |
| XLXmlFile & | operator= (const XLXmlFile &other)=default |
| The copy assignment operator. The default implementation has been used. | |
| XLXmlFile & | operator= (XLXmlFile &&other) noexcept=default |
| The move assignment operator. The default implementation has been used. | |
| XLDocument & | parentDoc () |
| This function provides access to the parent XLDocument object. | |
| const XLDocument & | parentDoc () const |
| This function provides access to the parent XLDocument object. | |
| XMLDocument & | xmlDocument () |
| This function provides access to the underlying XMLDocument object. | |
| const XMLDocument & | xmlDocument () const |
| This function provides access to the underlying XMLDocument object. | |
| std::string | getXmlPath () const |
| Retrieve the path of the XML data in the .xlsx zip archive via m_xmlData->getXmlPath. | |
Static Public Member Functions | |
| static std::string | makeInternalLocation (std::string_view sheetName, std::string_view cellRef) |
Friends | |
| class | XLCell |
| class | XLRow |
| class | XLWorkbook |
| class | XLTableCollection |
| class | XLSheetBase< XLWorksheet > |
Additional Inherited Members | |
Protected Member Functions inherited from OpenXLSX::XLXmlFile | |
| void | setXmlData (std::string_view xmlData) |
| Provide the XML data represented by the object. | |
| std::string | relationshipID () const |
| This function returns the relationship ID (the ID used in the XLRelationships objects) for the object. | |
Protected Attributes inherited from OpenXLSX::XLXmlFile | |
| XLXmlData * | m_xmlData {nullptr} |
A class encapsulating an Excel worksheet. Access to XLWorksheet objects should be via the workbook object.
| XLWorksheet::XLWorksheet | ( | ) |
The constructor does some slight reconfiguration of the XML file, in order to make parsing easier.
|
explicit |
|
default |
| XLWorksheet::XLWorksheet | ( | const XLWorksheet & | other | ) |
|
noexcept |
| XLChart XLWorksheet::addChart | ( | XLChartType | type, |
| const XLChartAnchor & | anchor | ||
| ) |
| XLChart XLWorksheet::addChart | ( | XLChartType | type, |
| std::string_view | name, | ||
| uint32_t | row, | ||
| uint32_t | col, | ||
| uint32_t | width, | ||
| uint32_t | height | ||
| ) |
| XLThreadedComment XLWorksheet::addComment | ( | std::string_view | cellRef, |
| std::string_view | text, | ||
| std::string_view | author = "" |
||
| ) |
Add a modern threaded comment to a cell seamlessly.
| cellRef | The cell reference (e.g. A1). |
| text | The comment text. |
| author | The author of the comment. |
| void XLWorksheet::addConditionalFormatting | ( | const std::string & | sqref, |
| const XLCfRule & | rule | ||
| ) |
| void XLWorksheet::addConditionalFormatting | ( | const std::string & | sqref, |
| const XLCfRule & | rule, | ||
| const XLDxf & | dxf | ||
| ) |
| void XLWorksheet::addConditionalFormatting | ( | const XLCellRange & | range, |
| const XLCfRule & | rule | ||
| ) |
| void XLWorksheet::addConditionalFormatting | ( | const XLCellRange & | range, |
| const XLCfRule & | rule, | ||
| const XLDxf & | dxf | ||
| ) |
| void XLWorksheet::addHyperlink | ( | std::string_view | cellRef, |
| std::string_view | url, | ||
| std::string_view | tooltip = "" |
||
| ) |
| void XLWorksheet::addImage | ( | const std::string & | name, |
| const std::string & | data, | ||
| uint32_t | row, | ||
| uint32_t | col, | ||
| uint32_t | width, | ||
| uint32_t | height, | ||
| const XLImageOptions & | options = XLImageOptions() |
||
| ) |
| void XLWorksheet::addInternalHyperlink | ( | std::string_view | cellRef, |
| std::string_view | location, | ||
| std::string_view | tooltip = "" |
||
| ) |
| void XLWorksheet::addNote | ( | std::string_view | cellRef, |
| std::string_view | text, | ||
| std::string_view | author = "" |
||
| ) |
Add a comment to a cell seamlessly.
| cellRef | The cell reference (e.g. A1). |
| text | The comment text. |
| author | The author of the comment. |
| void XLWorksheet::addPivotSlicer | ( | std::string_view | cellReference, |
| const XLPivotTable & | pivotTable, | ||
| std::string_view | columnName, | ||
| const XLSlicerOptions & | options = XLSlicerOptions() |
||
| ) |
Add a slicer connected to a Pivot Table.
| cellReference | The top-left cell where the slicer should be anchored. |
| pivotTable | The Pivot Table to filter. |
| columnName | The exact name of the pivot field (source column name) to filter. |
| options | The visual and naming options for the slicer. |
| XLPivotTable XLWorksheet::addPivotTable | ( | const XLPivotTableOptions & | options | ) |
Create and add a pivot table to this worksheet.
| options | The configuration options for the pivot table. |
| XLThreadedComment XLWorksheet::addReply | ( | const std::string & | parentId, |
| const std::string & | text, | ||
| const std::string & | author = "" |
||
| ) |
Add a reply to an existing threaded comment.
| parentId | The parent threaded comment ID. |
| text | The comment text. |
| author | The author of the comment. |
| void XLWorksheet::addScaledImage | ( | const std::string & | name, |
| const std::string & | data, | ||
| uint32_t | row, | ||
| uint32_t | col, | ||
| double | scalingFactor = 1.0 |
||
| ) |
| void XLWorksheet::addShape | ( | std::string_view | cellReference, |
| const XLVectorShapeOptions & | options | ||
| ) |
Insert an image at the specified cell with original dimensions (automatic parsing).
| cellReference | The top-left cell where the image should be anchored (e.g. "B2"). |
| imagePath | The file path to the local image. |
| void XLWorksheet::addSortCondition | ( | const std::string & | ref, |
| uint16_t | colId, | ||
| bool | descending = false |
||
| ) |
Set the sort state for the worksheet.
| ref | The cell range to apply the sort state to (e.g. "A1:C10"). |
| colId | The 0-based column index relative to the range to sort by. |
| descending | True for descending order, false for ascending. |
| void XLWorksheet::addSparkline | ( | const std::string & | location, |
| const std::string & | dataRange, | ||
| const XLSparklineOptions & | options | ||
| ) |
Add a sparkline graph with advanced configuration options.
| location | The cell or range where the sparkline will be rendered (e.g. "F1"). |
| dataRange | The source data range for the sparkline (e.g. "A1:E1"). |
| options | A structure containing extensive visual formatting options. |
| void XLWorksheet::addSparkline | ( | const std::string & | location, |
| const std::string & | dataRange, | ||
| XLSparklineType | type = XLSparklineType::Line |
||
| ) |
Add a sparkline to the worksheet.
| location | The cell where the sparkline is displayed (e.g., "A1"). |
| dataRange | The cell range containing the data (e.g., "B1:Z1"). |
| type | The type of the sparkline (Line, Column, Stacked). |
| void XLWorksheet::addTableSlicer | ( | std::string_view | cellReference, |
| const XLTable & | table, | ||
| std::string_view | columnName, | ||
| const XLSlicerOptions & | options = XLSlicerOptions() |
||
| ) |
Add a slicer connected to a table.
| cellReference | The top-left cell where the slicer should be anchored (e.g. "D1"). |
| table | The table to filter. |
| columnName | The exact name of the table column to filter. |
| options | The visual and naming options for the slicer. |
| bool XLWorksheet::allowAutoFilter | ( | bool | set = true | ) |
| bool XLWorksheet::allowDeleteColumns | ( | bool | set = true | ) |
| bool XLWorksheet::allowDeleteRows | ( | bool | set = true | ) |
| bool XLWorksheet::allowFormatCells | ( | bool | set = true | ) |
| bool XLWorksheet::allowFormatColumns | ( | bool | set = true | ) |
| bool XLWorksheet::allowFormatRows | ( | bool | set = true | ) |
| bool XLWorksheet::allowInsertColumns | ( | bool | set = true | ) |
| bool XLWorksheet::allowInsertHyperlinks | ( | bool | set = true | ) |
| bool XLWorksheet::allowInsertRows | ( | bool | set = true | ) |
| bool XLWorksheet::allowPivotTables | ( | bool | set = true | ) |
| bool XLWorksheet::allowSelectLockedCells | ( | bool | set = true | ) |
| bool XLWorksheet::allowSelectUnlockedCells | ( | bool | set = true | ) |
| bool XLWorksheet::allowSort | ( | bool | set = true | ) |
| void XLWorksheet::appendRow | ( | const std::vector< XLCellValue > & | values | ) |
Append a new row with the given values.
| values | A vector of XLCellValue items. |
|
inline |
Append a new row with the given container of values.
| T | A container type. |
| values | The container of values. |
| void XLWorksheet::applyAutoFilter | ( | ) |
Evaluates the current autoFilter conditions and hides rows that do not match the criteria. Note: Only basic text/value matching and some simple custom filters are evaluated. Complex dynamic filters might not be supported.
| std::string XLWorksheet::autoFilter | ( | ) | const |
| bool XLWorksheet::autoFilterAllowed | ( | ) | const |
| XLAutoFilter XLWorksheet::autofilterObject | ( | ) | const |
| void XLWorksheet::autoFitColumn | ( | uint16_t | columnNumber | ) |
Automatically adjusts the column width based on the content of its cells.
| XLCellAssignable XLWorksheet::cell | ( | const std::string & | ref | ) | const |
| XLCellAssignable XLWorksheet::cell | ( | const XLCellReference & | ref | ) | const |
| XLCellAssignable XLWorksheet::cell | ( | uint32_t | rowNumber, |
| uint16_t | columnNumber | ||
| ) | const |
|
inline |
| void XLWorksheet::clearAllConditionalFormatting | ( | ) |
| void XLWorksheet::clearAutoFilter | ( | ) |
| void XLWorksheet::clearPanes | ( | ) |
| bool XLWorksheet::clearPassword | ( | ) |
| bool XLWorksheet::clearSheetProtection | ( | ) |
| XLColumn XLWorksheet::column | ( | std::string const & | columnRef | ) | const |
| XLColumn XLWorksheet::column | ( | uint16_t | columnNumber | ) | const |
|
noexcept |
| XLComments & XLWorksheet::comments | ( | ) |
| XLConditionalFormats XLWorksheet::conditionalFormats | ( | ) | const |
| XLDataValidations & XLWorksheet::dataValidations | ( | ) |
| bool XLWorksheet::deleteColumn | ( | uint16_t | colNumber, |
| uint16_t | count = 1 |
||
| ) |
Delete one or more columns and shift subsequent columns left.
| colNumber | 1-based first column to delete. |
| count | Number of consecutive columns to delete (default 1). |
| bool XLWorksheet::deleteColumnsAllowed | ( | ) | const |
| void XLWorksheet::deleteComment | ( | std::string_view | cellRef | ) |
Remove a modern threaded comment (and its replies) from a cell.
| cellRef | The cell reference (e.g. A1). |
| void XLWorksheet::deleteNote | ( | std::string_view | cellRef | ) |
Remove a legacy yellow note from a cell.
| cellRef | The cell reference (e.g. A1). |
| bool XLWorksheet::deletePivotTable | ( | std::string_view | name | ) |
Delete a pivot table by name from this worksheet.
| name | The name of the pivot table to delete. |
| bool XLWorksheet::deleteRow | ( | uint32_t | rowNumber | ) |
| bool XLWorksheet::deleteRow | ( | uint32_t | rowNumber, |
| uint32_t | count | ||
| ) |
Delete one or more rows and shift subsequent rows up.
All subsystems (merges, formulas, drawings, validations, autoFilter) are updated automatically.
| rowNumber | 1-based first row to delete. |
| count | Number of consecutive rows to delete (default 1). |
| bool XLWorksheet::deleteRowsAllowed | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| XLDrawing & XLWorksheet::drawing | ( | ) |
| XLCellAssignable XLWorksheet::findCell | ( | const std::string & | ref | ) | const |
| XLCellAssignable XLWorksheet::findCell | ( | const XLCellReference & | ref | ) | const |
| XLCellAssignable XLWorksheet::findCell | ( | uint32_t | rowNumber, |
| uint16_t | columnNumber | ||
| ) | const |
| void XLWorksheet::fitToPages | ( | uint32_t | fitToWidth, |
| uint32_t | fitToHeight | ||
| ) |
| bool XLWorksheet::formatCellsAllowed | ( | ) | const |
| bool XLWorksheet::formatColumnsAllowed | ( | ) | const |
| bool XLWorksheet::formatRowsAllowed | ( | ) | const |
| void XLWorksheet::freezePanes | ( | const std::string & | topLeftCell | ) |
Freeze panes at the specified top-left cell. This is a highly ergonomic method. E.g. freezePanes("B2") freezes Row 1 and Column A.
| topLeftCell | The cell reference where the scrolling data should start. |
| void XLWorksheet::freezePanes | ( | uint16_t | column, |
| uint32_t | row | ||
| ) |
| XLStyleIndex XLWorksheet::getColumnFormat | ( | const std::string & | column | ) | const |
| XLStyleIndex XLWorksheet::getColumnFormat | ( | uint16_t | column | ) | const |
| std::string XLWorksheet::getHyperlink | ( | std::string_view | cellRef | ) | const |
| XLStyleIndex XLWorksheet::getRowFormat | ( | uint16_t | row | ) | const |
| void XLWorksheet::groupColumns | ( | uint16_t | colFirst, |
| uint16_t | colLast, | ||
| uint8_t | outlineLevel = 1, |
||
| bool | collapsed = false |
||
| ) |
| void XLWorksheet::groupRows | ( | uint32_t | rowFirst, |
| uint32_t | rowLast, | ||
| uint8_t | outlineLevel = 1, |
||
| bool | collapsed = false |
||
| ) |
| bool XLWorksheet::hasAutoFilter | ( | ) | const |
| bool XLWorksheet::hasComments | ( | ) | const |
| bool XLWorksheet::hasDrawing | ( | ) | const |
| bool XLWorksheet::hasHyperlink | ( | std::string_view | cellRef | ) | const |
| bool XLWorksheet::hasPanes | ( | ) | const |
| bool XLWorksheet::hasRelationships | ( | ) | const |
| bool XLWorksheet::hasTables | ( | ) | const |
| bool XLWorksheet::hasThreadedComments | ( | ) | const |
| bool XLWorksheet::hasVmlDrawing | ( | ) | const |
| XLHeaderFooter XLWorksheet::headerFooter | ( | ) | const |
| std::vector< XLDrawingItem > XLWorksheet::images | ( | ) |
| void XLWorksheet::insertColBreak | ( | uint16_t | col | ) |
| bool XLWorksheet::insertColumn | ( | uint16_t | colNumber, |
| uint16_t | count = 1 |
||
| ) |
Insert one or more empty columns before the given column number.
| colNumber | 1-based column to insert before. |
| count | Number of columns to insert (default 1). |
| bool XLWorksheet::insertColumnsAllowed | ( | ) | const |
| bool XLWorksheet::insertHyperlinksAllowed | ( | ) | const |
| void XLWorksheet::insertImage | ( | const std::string & | cellReference, |
| const std::string & | imagePath | ||
| ) |
| void XLWorksheet::insertImage | ( | const std::string & | cellReference, |
| const std::string & | imagePath, | ||
| const XLImageOptions & | options | ||
| ) |
Insert an image with advanced formatting options (scaling, offset, behavior).
| cellReference | The top-left cell where the image should be anchored (e.g. "B2"). |
| imagePath | The file path to the local image. |
| options | An XLImageOptions struct specifying formatting and behavior. |
| bool XLWorksheet::insertRow | ( | uint32_t | rowNumber, |
| uint32_t | count = 1 |
||
| ) |
Insert one or more empty rows before the given row number.
All rows at rowNumber and below are shifted down. Merged ranges, formulas, drawing anchors, data validations and the autoFilter reference are all updated to reflect the new layout.
| rowNumber | 1-based row to insert before. |
| count | Number of rows to insert (default 1). |
| void XLWorksheet::insertRowBreak | ( | uint32_t | row | ) |
| bool XLWorksheet::insertRowsAllowed | ( | ) | const |
|
noexcept |
|
static |
| XLCellRange XLWorksheet::mergeCells | ( | const std::string & | rangeReference, |
| bool | emptyHiddenCells = false |
||
| ) |
| XLCellRange XLWorksheet::mergeCells | ( | XLCellRange const & | rangeToMerge, |
| bool | emptyHiddenCells = false |
||
| ) |
| XLMergeCells & XLWorksheet::merges | ( | ) |
| bool XLWorksheet::objectsProtected | ( | ) | const |
| XLWorksheet & XLWorksheet::operator= | ( | const XLWorksheet & | other | ) |
| XLWorksheet & XLWorksheet::operator= | ( | XLWorksheet && | other | ) |
| XLPageMargins XLWorksheet::pageMargins | ( | ) | const |
| XLPageSetup XLWorksheet::pageSetup | ( | ) | const |
| std::string XLWorksheet::passwordHash | ( | ) | const |
| bool XLWorksheet::passwordIsSet | ( | ) | const |
| std::optional< XLCell > XLWorksheet::peekCell | ( | const std::string & | ref | ) | const |
| std::optional< XLCell > XLWorksheet::peekCell | ( | const XLCellReference & | ref | ) | const |
| std::optional< XLCell > XLWorksheet::peekCell | ( | uint32_t | rowNumber, |
| uint16_t | columnNumber | ||
| ) | const |
|
inline |
| std::vector< XLPivotTable > XLWorksheet::pivotTables | ( | ) |
Retrieves all pivot tables belonging to this worksheet.
| bool XLWorksheet::pivotTablesAllowed | ( | ) | const |
| XLPrintOptions XLWorksheet::printOptions | ( | ) | const |
| bool XLWorksheet::protect | ( | const XLSheetProtectionOptions & | options, |
| std::string_view | password = "" |
||
| ) |
Protect the worksheet with granular options.
| options | A structure containing specific protection flags. |
| password | Optional password to protect the sheet. |
| bool XLWorksheet::protectObjects | ( | bool | set = true | ) |
| bool XLWorksheet::protectScenarios | ( | bool | set = true | ) |
| bool XLWorksheet::protectSheet | ( | bool | set = true | ) |
| XLCellRange XLWorksheet::range | ( | ) | const |
| XLCellRange XLWorksheet::range | ( | const XLCellReference & | topLeft, |
| const XLCellReference & | bottomRight | ||
| ) | const |
| XLCellRange XLWorksheet::range | ( | std::string const & | rangeReference | ) | const |
| XLCellRange XLWorksheet::range | ( | std::string const & | topLeft, |
| std::string const & | bottomRight | ||
| ) | const |
| void XLWorksheet::removeColBreak | ( | uint16_t | col | ) |
| void XLWorksheet::removeConditionalFormatting | ( | const std::string & | sqref | ) |
| void XLWorksheet::removeConditionalFormatting | ( | const XLCellRange & | range | ) |
| void XLWorksheet::removeHyperlink | ( | std::string_view | cellRef | ) |
| void XLWorksheet::removeRowBreak | ( | uint32_t | row | ) |
| XLRow XLWorksheet::row | ( | uint32_t | rowNumber | ) | const |
|
noexcept |
| XLRowRange XLWorksheet::rows | ( | ) | const |
| XLRowRange XLWorksheet::rows | ( | uint32_t | firstRow, |
| uint32_t | lastRow | ||
| ) | const |
| XLRowRange XLWorksheet::rows | ( | uint32_t | rowCount | ) | const |
| bool XLWorksheet::scenariosProtected | ( | ) | const |
| bool XLWorksheet::selectLockedCellsAllowed | ( | ) | const |
| bool XLWorksheet::selectUnlockedCellsAllowed | ( | ) | const |
| void XLWorksheet::setAutoFilter | ( | const XLCellRange & | range | ) |
| bool XLWorksheet::setColumnFormat | ( | const std::string & | column, |
| XLStyleIndex | cellFormatIndex | ||
| ) |
| bool XLWorksheet::setColumnFormat | ( | uint16_t | column, |
| XLStyleIndex | cellFormatIndex | ||
| ) |
| bool XLWorksheet::setPassword | ( | std::string | password | ) |
| bool XLWorksheet::setPasswordHash | ( | std::string | hash | ) |
| void XLWorksheet::setPrintArea | ( | const std::string & | sqref | ) |
Set the print area for this worksheet.
| sqref | The cell range (e.g., "A1:F50"). |
| void XLWorksheet::setPrintTitleCols | ( | uint16_t | firstCol, |
| uint16_t | lastCol | ||
| ) |
Set columns to repeat at the left of each printed page.
| firstCol | The first column to repeat (1-based). |
| lastCol | The last column to repeat (1-based). |
| void XLWorksheet::setPrintTitleRows | ( | uint32_t | firstRow, |
| uint32_t | lastRow | ||
| ) |
Set rows to repeat at the top of each printed page.
| firstRow | The first row to repeat (1-based). |
| lastRow | The last row to repeat (1-based). |
| bool XLWorksheet::setRowFormat | ( | uint32_t | row, |
| XLStyleIndex | cellFormatIndex | ||
| ) |
| void XLWorksheet::setSheetViewMode | ( | std::string_view | mode | ) |
| void XLWorksheet::setShowGridLines | ( | bool | show | ) |
| void XLWorksheet::setShowRowColHeaders | ( | bool | show | ) |
| void XLWorksheet::setZoom | ( | uint16_t | scale | ) |
| bool XLWorksheet::sheetProtected | ( | ) | const |
| std::string XLWorksheet::sheetProtectionSummary | ( | ) | const |
| std::string XLWorksheet::sheetViewMode | ( | ) | const |
| bool XLWorksheet::showGridLines | ( | ) | const |
| bool XLWorksheet::showRowColHeaders | ( | ) | const |
| bool XLWorksheet::sortAllowed | ( | ) | const |
| void XLWorksheet::splitPanes | ( | double | xSplit, |
| double | ySplit, | ||
| std::string_view | topLeftCell = "", |
||
| XLPane | activePane = XLPane::BottomRight |
||
| ) |
| XLStreamReader XLWorksheet::streamReader | ( | ) | const |
Create a stream reader for memory efficient reading of large documents.
| XLStreamWriter XLWorksheet::streamWriter | ( | ) |
Starts a high-performance, low-memory stream writer for this worksheet.
| XLTableCollection & XLWorksheet::tables | ( | ) |
| XLThreadedComments & XLWorksheet::threadedComments | ( | ) |
| void XLWorksheet::unmergeCells | ( | const std::string & | rangeReference | ) |
| void XLWorksheet::unmergeCells | ( | XLCellRange const & | rangeToMerge | ) |
| void XLWorksheet::updateDimension | ( | ) |
| void XLWorksheet::updateSheetName | ( | const std::string & | oldName, |
| const std::string & | newName | ||
| ) |
| XLVmlDrawing & XLWorksheet::vmlDrawing | ( | ) |
| uint16_t XLWorksheet::zoom | ( | ) | const |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |