資源簡(jiǎn)介
這個(gè)是xlsLib編譯后生成的動(dòng)態(tài)庫(kù),能夠?qū)?nèi)容寫(xiě)入到excle表內(nèi),支持中文。壓縮包里面包含了:動(dòng)態(tài)庫(kù)(包括靜態(tài)動(dòng)態(tài)庫(kù)),測(cè)試代碼和需要的頭文件。
代碼片段和文件信息
#include?
#include?
#include?“xlslib.h“
using?namespace?xlslib_core;
using?namespace?std;
//測(cè)試環(huán)境??unicode?和多字節(jié)都可以
std::string?ws2s(const?std::wstring&?ws)
{
std::string?curLocale?=?setlocale(LC_ALL?NULL);????????//?curLocale?=?“C“;
setlocale(LC_ALL?“chs“);
const?wchar_t*?_Source?=?ws.c_str();
size_t?_Dsize?=?2?*?ws.size()?+?1;
char?*_Dest?=?new?char[_Dsize];
memset(_Dest?0?_Dsize);
wcstombs(_Dest?_Source?_Dsize);
std::string?result?=?_Dest;
delete[]_Dest;
setlocale(LC_ALL?curLocale.c_str());
return?result;
}
std::wstring?s2ws(const?std::string&?s)
{
setlocale(LC_ALL?“chs“);
const?char*?_Source?=?s.c_str();
size_t?_Dsize?=?s.size()?+?1;
wchar_t?*_Dest?=?new?wchar_t[_Dsize];
wmemset(_Dest?0?_Dsize);
mbstowcs(_Dest?_Source?_Dsize);
std::wstring?result?=?_Dest;
delete[]_Dest;
setlocale(LC_ALL?“C“);
return?result;
}
/*
indows的一些:
新細(xì)明體:PMingLiU
細(xì)明體:MingLiU
標(biāo)楷體:DFKai-SB
黑體:SimHei
宋體:SimSun
新宋體:NSimSun
仿宋:FangSong
楷體:KaiTi
仿宋_GB2312:FangSong_GB2312
楷體_GB2312:KaiTi_GB2312
微軟正黑體:Microsoft?JhengHei
微軟雅黑體:Microsoft?YaHei
*/
int?main(int?argc?char?*argv[])?{
workbook?wb;//工作薄
font_t?*?_font?=?wb.font(“SimSun“);//設(shè)置字體
_font->SetBoldstyle(BOLDNESS_BOLD);??//?設(shè)置粗字體
xf_t*?xf?=?wb.xformat();
xf->SetFont(_font);
xf->SetFillBGColor(CLR_WHITE);
xf->SetFillFGColor(CLR_RED);
worksheet*?ws;//sheet
ws?=?wb.sheet(“sheet1“);
//ws->defaultColwidth(256?*?10);//設(shè)置行寬
//ws->colwidth(2?256?*?30);//設(shè)置行寬
cell_t?*?cell;
//一次操作
string?label?=?“Hello?World!“;
cell?=?ws->label(1?2?label?xf);????//?從0開(kāi)始數(shù),第1行,第2列,即C3
//一次操作
string?label2?=?“中文測(cè)試1“;
cell?=?ws->label(1?3?s2ws(label2)?xf);????//?從0開(kāi)始數(shù),第1行,第2列,即C3
cell->fillfgcolor(CLR_RED);
cell->fillbgcolor(CLR_WHITE);
//range?*?_range;
//_range?=?ws->rangegroup(0?0?1500?100);???//?設(shè)置背景為白色
//_range->cellcolor(CLR_WHITE);
//_range?=?ws->rangegroup(1?2?2?2);
//_range->cellcolor(CLR_GOLD);
wb.Dump(“test.xls“);
return?0;
}
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-11-29?14:31??include\
?????文件????????7751??2014-11-02?18:10??include\ac-config.win32.h
?????目錄???????????0??2016-11-29?14:31??include\src\
?????目錄???????????0??2016-11-29?14:31??include\src\common\
?????文件????????2229??2014-11-02?18:10??include\src\common\overnew.h
?????文件????????4860??2014-11-02?18:10??include\src\common\stringtok.h
?????文件????????9013??2014-11-02?18:10??include\src\common\systype.h
?????文件????????3279??2014-11-02?18:10??include\src\common\timespan.h
?????文件????????3984??2014-11-02?18:10??include\src\common\xlstypes.h
?????文件????????4183??2014-11-02?18:10??include\src\common\xlsys.h
?????文件????????1956??2014-11-02?18:10??include\src\common\xls_poppack.h
?????文件????????1969??2014-11-02?18:10??include\src\common\xls_pshpack1.h
?????文件????????1969??2014-11-02?18:10??include\src\common\xls_pshpack2.h
?????文件????????1969??2014-11-02?18:10??include\src\common\xls_pshpack4.h
?????目錄???????????0??2016-11-29?14:32??include\src\oledoc\
?????文件????????2763??2014-11-02?18:10??include\src\oledoc\binfile.h
?????文件????????5935??2014-11-02?18:10??include\src\oledoc\oledoc.h
?????文件????????2862??2014-11-02?18:10??include\src\oledoc\olefs.h
?????文件????????4359??2014-11-02?18:10??include\src\oledoc\oleprop.h
?????目錄???????????0??2016-11-29?14:32??include\src\xlslib\
?????文件????????2067??2014-11-02?18:10??include\src\xlslib\biffsection.h
?????文件????????2455??2014-11-02?18:10??include\src\xlslib\blank.h
?????文件????????2507??2014-11-02?18:10??include\src\xlslib\boolean.h
?????文件????????1740??2014-11-02?18:10??include\src\xlslib\cbridge.h
?????文件????????5026??2014-11-02?18:10??include\src\xlslib\cell.h
?????文件????????2576??2014-11-02?18:10??include\src\xlslib\colinfo.h
?????文件????????6404??2014-11-02?18:10??include\src\xlslib\colors.h
?????文件????????2760??2014-11-02?18:10??include\src\xlslib\common.h
?????文件????????2118??2014-11-02?18:10??include\src\xlslib\continue.h
?????文件???????10502??2014-11-02?18:10??include\src\xlslib\datast.h
?????文件????????3339??2014-11-02?18:10??include\src\xlslib\docsumminfo.h
............此處省略43個(gè)文件信息
評(píng)論
共有 條評(píng)論