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
Writing to memory buffer
This example shows how to write an Excel spreadsheet into memory buffer.#include "libxl.h"
#include <fstream>
using namespace libxl;
int main()
{
Book* book = xlCreateBook();
Sheet* sheet = book->addSheet(L"Sheet1");
const char* data;
unsigned size;
if(book->saveRaw(&data, &size))
{
std::fstream stream("output.xls", std::ios_base::out | std::ios_base::binary);
stream.write(data, size);
}
book->release();
return 0;
}