Skip to main content

Метод PivotTable::getColumnFields

Метод возвращает список полей PivotTableCategoryField``из области колонок.

Пример​


boost::optional<PivotTablesManager> pivotTablesManagerOpt = document.getPivotTablesManager();
PivotTablesManager pivotTablesManager = pivotTablesManagerOpt.get();
PivotTable pivotTable = pivotTablesManager.create(cellRange);
PivotTableCategoryFields columnFields = pivotTable.getColumnFields();
for (int i = 0; i < columnFields.size(); i++)
{
std::printf("%s", columnFields[i].fieldProperties.fieldAlias.get());
std::printf("%s", columnFields[i].fieldProperties.subtotalAlias.get());
std::printf("%d", columnFields[i].fieldProperties.fieldName.c_str());
for (int j = 0; j < columnFields[i].subtotalFunctions.size(); j++)
{
std::printf("%d", columnFields[i].subtotalFunctions[j]);
}
}