---
Product: Aspose.Cells
Platform: cpp
Page Type: reference
Canonical URL: https://reference.aspose.org/cells/cpp/xlsxworkbookserializercommon
---

# XlsxWorkbookSerializerCommon

## Overview

`XlsxWorkbookSerializerCommon` is a class in Aspose.Cells FOSS for C++.

Constants and helpers shared across the XLSX workbook serializer.

This class declares 24 methods for XlsxWorkbookSerializerCommon objects in C++ programs.
Available methods include: `BuildCell`, `BuildColumnElement`, `BuildContentTypes`, `BuildMinimalStylesheet`, `BuildRootRelationships`, `BuildRowElement`, `BuildSharedStrings`, `BuildWorkbook`, `BuildWorkbookRelationships`, `BuildWorksheet`, `CalculateDimensionReference`, `ColumnMetadataEqual`, and 12 additional methods.
Public members are accessible to any C++ application after installing the Aspose.Cells FOSS for C++ package.
Accessor methods: `BuiltInDateFormats`, `ContentTypeNs`, `CorePropertiesRelationshipType`, `ExtendedPropertiesRelationshipType`, `MainNs`, `PackageRelationshipNs`, and 5 more.

## Accessor Methods

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `WorksheetRelationshipType` | `std::string` | Read/Write | Gets or sets the worksheet relationship type. |
| `SharedStringsRelationshipType` | `std::string` | Read/Write | Gets or sets the shared strings relationship type. |
| `StylesRelationshipType` | `std::string` | Read/Write | Gets or sets the styles relationship type. |
| `CorePropertiesRelationshipType` | `std::string` | Read/Write | Gets or sets the core properties relationship type. |
| `ExtendedPropertiesRelationshipType` | `std::string` | Read/Write | Gets or sets the extended properties relationship type. |
| `MainNs` | `XNamespace` | Read/Write | Gets or sets the main ns. |
| `RelationshipNs` | `XNamespace` | Read/Write | Gets or sets the relationship ns. |
| `PackageRelationshipNs` | `XNamespace` | Read/Write | Gets or sets the package relationship ns. |
| `ContentTypeNs` | `XNamespace` | Read/Write | Gets or sets the content type ns. |
| `XmlNs` | `XNamespace` | Read/Write | Gets or sets the xml ns. |
| `BuiltInDateFormats` | `std::unordered_set<int>` | Read/Write | Gets or sets the built in date formats. |

## Methods

| Signature | Description |
|-----------|-------------|
| `XlsxWorkbookSerializerCommon()` | Calls XlsxWorkbookSerializerCommon on this XlsxWorkbookSerializerCommon instance. |
| `ShouldPersistCell(workbookDefaultStyle: Core::StyleValue, record: Core::CellRecord)` → `bool` | Returns true if the cell record should be persisted to the worksheet XML. |
| `WriteXmlEntry(archive: ZipArchive, path: std::string_view, document: XmlDocument)` | Serializes an XmlDocument to UTF-8 and writes it as a ZIP entry. |
| `BuildContentTypes(model: Core::WorkbookModel, hasSharedStrings: bool, hasDateStyles: bool, hasCoreProperties: bool, hasExtendedProperties: bool)` → `XmlDocument` | Builds the [Content_Types].xml document. |
| `BuildRootRelationships(hasCoreProperties: bool, hasExtendedProperties: bool)` → `XmlDocument` | Builds the root _rels/.rels document. |
| `BuildWorkbook(model: Core::WorkbookModel)` → `XmlDocument` | Builds the xl/workbook.xml document. |
| `BuildWorkbookRelationships(model: Core::WorkbookModel, hasSharedStrings: bool, hasDateStyles: bool)` → `XmlDocument` | Builds the xl/_rels/workbook.xml.rels document. |
| `BuildWorksheet(worksheet: Core::WorksheetModel, workbookDefaultStyle: Core::StyleValue, dateSystem: Core::DateSystem, sharedStrings: Core::SharedStringRepository, options: SaveOptions, stylesheet: StylesheetSaveContext)` → `XmlDocument` | Builds an xl/worksheets/sheetN.xml document. |
| `BuildSharedStrings(sharedStrings: Core::SharedStringRepository)` → `XmlDocument` | Builds the xl/sharedStrings.xml document. |
| `BuildMinimalStylesheet()` → `XmlDocument` | Builds a minimal xl/styles.xml document. |
| `BuildRowElement(rowIndex: int, rowModel: Core::RowModel, rowCells: std::vector<std::pair<Core::CellAddress, Core::CellRecord>>, dateSystem: Core::DateSystem, sharedStrings: Core::SharedStringRepository, options: SaveOptions, stylesheet: StylesheetSaveContext)` → `XmlElement` | Builds a row element with its child cells. |
| `BuildColumnElement(column: Core::ColumnRangeModel)` → `XmlElement` | Builds a col element for a column range. |
| `BuildCell(address: Core::CellAddress, record: Core::CellRecord, dateSystem: Core::DateSystem, sharedStrings: Core::SharedStringRepository, options: SaveOptions, stylesheet: StylesheetSaveContext)` → `XmlElement` | Builds a cell element (c element). |
| `CreateTextElement(value: std::string_view)` → `XmlElement` | Creates a text element (t element) with optional xml:space="preserve". |
| `HasRowMetadata(rowModel: Core::RowModel)` → `bool` | Returns true if the row model has any non-default metadata. |
| `HasColumnMetadata(column: Core::ColumnRangeModel)` → `bool` | Returns true if the column range has any non-default metadata. |
| `NeedsPreserveWhitespace(value: std::string_view)` → `bool` | Checks whether a string value needs xml:space="preserve". |
| `GetWorksheetRowIndexes(persistedCells: std::vector<std::pair<Core::CellAddress, Core::CellRecord>>, rows: std::unordered_map<int, Core::RowModel>)` → `std::vector<int>` | Collects and sorts the union of row indexes from persisted cells and row metadata. |
| `NormalizeColumnRanges(columns: std::vector<Core::ColumnRangeModel>)` → `std::vector<Core::ColumnRangeModel>` | Filters, sorts, and merges adjacent column ranges that share the same metadata. |
| `ColumnMetadataEqual(left: Core::ColumnRangeModel, right: Core::ColumnRangeModel)` → `bool` | Returns true if two column ranges have identical metadata. |
| `CalculateDimensionReference(persistedCells: std::vector<std::pair<Core::CellAddress, Core::CellRecord>>, mergeRegions: std::vector<Core::MergeRegion>)` → `std::string` | Calculates the dimension reference string for the sheetData dimension element. |
| `ToRangeReference(region: Core::MergeRegion)` → `std::string` | Converts a merge region to a range reference string (e.g. "A1:B2"). |
| `TryParseMergeReference(mergeReference: std::string_view, region: Core::MergeRegion)` → `bool` | Parses a range reference string into a merge region. Returns true on success. |
| `TryParseCellReference(cellReference: std::string_view, address: Core::CellAddress)` → `bool` | Parses a cell reference string into a CellAddress. Returns true on success. |

## See Also

- [Aspose.Cells — Enterprise API Reference](https://reference.aspose.com/cells/)