You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
770 B
33 lines
770 B
#include <iostream>
|
|
#include <conio.h>
|
|
#include "libxl.h"
|
|
|
|
using namespace libxl;
|
|
|
|
int main()
|
|
{
|
|
Book* book = xlCreateBook();
|
|
if(book)
|
|
{
|
|
Sheet* sheet = book->addSheet(L"Sheet1");
|
|
if(sheet)
|
|
{
|
|
sheet->writeStr(2, 1, L"Hello, World !");
|
|
sheet->writeNum(3, 1, 1000);
|
|
|
|
Format* dateFormat = book->addFormat();
|
|
dateFormat->setNumFormat(NUMFORMAT_DATE);
|
|
sheet->writeNum(4, 1, book->datePack(2008, 4, 29), dateFormat);
|
|
|
|
sheet->setCol(1, 1, 12);
|
|
}
|
|
|
|
if(book->save(L"example.xls")) std::cout << "\nFile example.xls has been created." << std::endl;
|
|
book->release();
|
|
}
|
|
|
|
std::cout << "\nPress any key to exit...";
|
|
_getch();
|
|
|
|
return 0;
|
|
}
|
|
|