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
Merging cells
This example creates merging cells. See the result in the merge.xls file.#include "libxl.h"
using namespace libxl;
int main()
{
Book* book = xlCreateBook();
Format* format = book->addFormat();
format->setAlignH(ALIGNH_CENTER);
format->setAlignV(ALIGNV_CENTER);
Sheet* sheet = book->addSheet(L"Sheet1");
sheet->writeStr(3, 1, L"Hello World !", format);
sheet->setMerge(3, 5, 1, 5);
sheet->setMerge(7, 20, 1, 2);
sheet->setMerge(7, 20, 4, 5);
sheet->writeNum(7, 1, 1, format);
sheet->writeNum(7, 4, 2, format);
book->save(L"merge.xls");
book->release();
return 0;
}