Grouping rows and columns
This examples shows how to group rows and columns. See result in group.xls.#include "libxl.h"
#include <stdlib.h>
using namespace libxl;
int main()
{
Book* book = xlCreateBook();
Sheet* sheet = book->addSheet(L"Sheet1");
for(unsigned short row = 1; row < 30; ++row)
{
for(unsigned short 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;
}