Home Documentation Writing Reading Pictures1 Pictures2 Formulas DateTime SheetByName
Merging Grouping InsertRowCol NumFormats Formats Fonts Buffer1 Buffer2 Copying TopNFilter
Sorting StringFilter NumberFilter FilterByValues Protection Replacing RichString BeginWith
ColorScale OpRule AltRows
Merging Grouping InsertRowCol NumFormats Formats Fonts Buffer1 Buffer2 Copying TopNFilter
Sorting StringFilter NumberFilter FilterByValues Protection Replacing RichString BeginWith
ColorScale OpRule AltRows
Grouping rows and columns
This examples shows how to group rows and columns. See the result in the group.xls file.#include "libxl.h"
#include <stdlib.h>
using namespace libxl;
int main()
{
Book* book = xlCreateBook();
Sheet* sheet = book->addSheet(L"Sheet1");
for(int row = 1; row < 30; ++row)
{
for(int col = 0; col < 10; ++col)
{
sheet->writeNum(row, col, rand() % 10);
}
}
sheet->groupCols(0, 1);
sheet->groupCols(4, 7, false);
sheet->groupRows(3, 6);
sheet->groupRows(10, 25, false);
sheet->groupRows(14, 16, false);
sheet->groupRows(19, 21, false);
book->save(L"group.xls");
book->release();
return 0;
}