首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

libxl 4.0.3读取Excel

服务器应用 9.54MB 14 需要积分: 1
立即下载

资源介绍:

读取表格速度很快
#include #include #include "libxl.h" using namespace libxl; int main() { Book* book = xlCreateXMLBook(); book->setLocale("UTF-8"); if(book) { Font* boldFont = book->addFont(); boldFont->setBold(); Font* titleFont = book->addFont(); titleFont->setName(L"Arial Black"); titleFont->setSize(16); Format* titleFormat = book->addFormat(); titleFormat->setFont(titleFont); Format* headerFormat = book->addFormat(); headerFormat->setAlignH(ALIGNH_CENTER); headerFormat->setBorder(BORDERSTYLE_THIN); headerFormat->setFont(boldFont); headerFormat->setFillPattern(FILLPATTERN_SOLID); headerFormat->setPatternForegroundColor(COLOR_TAN); Format* descriptionFormat = book->addFormat(); descriptionFormat->setBorderLeft(BORDERSTYLE_THIN); Format* amountFormat = book->addFormat(); amountFormat->setNumFormat(NUMFORMAT_CURRENCY_NEGBRA); amountFormat->setBorderLeft(BORDERSTYLE_THIN); amountFormat->setBorderRight(BORDERSTYLE_THIN); Format* totalLabelFormat = book->addFormat(); totalLabelFormat->setBorderTop(BORDERSTYLE_THIN); totalLabelFormat->setAlignH(ALIGNH_RIGHT); totalLabelFormat->setFont(boldFont); Format* totalFormat = book->addFormat(); totalFormat->setNumFormat(NUMFORMAT_CURRENCY_NEGBRA); totalFormat->setBorder(BORDERSTYLE_THIN); totalFormat->setFont(boldFont); totalFormat->setFillPattern(FILLPATTERN_SOLID); totalFormat->setPatternForegroundColor(COLOR_YELLOW); Format* signatureFormat = book->addFormat(); signatureFormat->setAlignH(ALIGNH_CENTER); signatureFormat->setBorderTop(BORDERSTYLE_THIN); Sheet* sheet = book->addSheet(L"Invoice"); if(sheet) { sheet->writeStr(2, 1, L"Invoice No. 3568", titleFormat); sheet->writeStr(4, 1, L"Name: John Smith"); sheet->writeStr(5, 1, L"Address: San Ramon, CA 94583 USA"); sheet->writeStr(7, 1, L"Description", headerFormat); sheet->writeStr(7, 2, L"Amount", headerFormat); sheet->writeStr(8, 1, L"Ball-Point Pens", descriptionFormat); sheet->writeNum(8, 2, 85, amountFormat); sheet->writeStr(9, 1, L"T-Shirts", descriptionFormat); sheet->writeNum(9, 2, 150, amountFormat); sheet->writeStr(10, 1, L"Tea cups", descriptionFormat); sheet->writeNum(10, 2, 45, amountFormat); sheet->writeStr(11, 1, L"Total:", totalLabelFormat); sheet->writeFormula(11, 2, L"=SUM(C9:C11)", totalFormat); sheet->writeStr(14, 2, L"Signature", signatureFormat); sheet->setCol(1, 1, 40); sheet->setCol(2, 2, 15); } Sheet* sheet2 = book->addSheet(L"Writing a rich string with multiple fonts in one cell"); if(sheet2) { RichString* rs = book->addRichString(); Font* font1 = rs->addFont(); font1->setColor(COLOR_RED); font1->setSize(24); Font* font2 = rs->addFont(); font2->setSize(24); Font* font3 = rs->addFont(); font3->setColor(COLOR_BLUE); font3->setSize(24); Font* font4 = rs->addFont(); font4->setColor(COLOR_GREEN); font4->setSize(24); Font* font5 = rs->addFont(); font5->setScript(SCRIPT_SUPER); font5->setSize(24); rs->addText(L"E", font1); rs->addText(L"=", font2); rs->addText(L"m", font3); rs->addText(L"c", font4); rs->addText(L"2", font5); sheet2->writeRichStr(5, 3, rs); sheet2->setProtect(true); } Format* alFormat = book->addFormat(); alFormat->setAlignH(ALIGNH_LEFT); Format* arFormat = book->addFormat(); arFormat->setAlignH(ALIGNH_RIGHT); Format* alignDateFormat = book->addFormat(alFormat); alignDateFormat->setNumFormat(NUMFORMAT_DATE); Font* linkFont = book->addFont(); linkFont->setColor(COLOR_BLUE); linkFont->setUnderline(UNDERLINE_SINGLE); Format* linkFormat = book->addFormat(alFormat); linkFormat->setFont(linkFont); Sheet* sheet3 = book->addSheet(L"Formula"); if(sheet3) { sheet3->setCol(0, 0, 27); sheet3->setCol(1, 1, 10); sheet3->writeNum(2, 1, 40, alFormat); sheet3->writeNum(3, 1, 30, alFormat); sheet3->writeNum(4, 1, 50, alFormat); sheet3->writeStr(6, 0, L"SUM(B3:B5) = L", arFormat); sheet3->writeFormula(6, 1, L"SUM(B3:B5)", alFormat); sheet3->writeStr(7, 0, L"AVERAGE(B3:B5) = L", arFormat); sheet3->writeFormula(7, 1, L"AVERAGE(B3:B5)", alFormat); sheet3->writeStr(8, 0, L"MAX(B3:B5) = L", arFormat); sheet3->writeFormula(8, 1, L"MAX(B3:B5)", alFormat); sheet3->writeStr(9, 0, L"MIX(B3:B5) = L", arFormat); sheet3->writeFormula(9, 1, L"MIN(B3:B5)", alFormat); sheet3->writeStr(10, 0, L"COUNT(B3:B5) = L", arFormat); sheet3->writeFormula(10, 1, L"COUNT(B3:B5)", alFormat); sheet3->writeStr(12, 0, L"IF(B7 > 100;\"large\";\"small\") = L", arFormat); sheet3->writeFormula(12, 1, L"IF(B7 > 100;\"large\";\"small\")", alFormat); sheet3->writeStr(14, 0, L"SQRT(25) = L", arFormat); sheet3->writeFormula(14, 1, L"SQRT(25)", alFormat); sheet3->writeStr(15, 0, L"RAND() = L", arFormat); sheet3->writeFormula(15, 1, L"RAND()", alFormat); sheet3->writeStr(16, 0, L"2*PI() = L", arFormat); sheet3->writeFormula(16, 1, L"2*PI()", alFormat); sheet3->writeStr(18, 0, L"UPPER(\"libxl\") = L", arFormat); sheet3->writeFormula(18, 1, L"UPPER(\"libxl\")", alFormat); sheet3->writeStr(19, 0, L"LEFT(\"window\";3) = L", arFormat); sheet3->writeFormula(19, 1, L"LEFT(\"window\";3)", alFormat); sheet3->writeStr(20, 0, L"LEN(\"string\") = L", arFormat); sheet3->writeFormula(20, 1, L"LEN(\"string\")", alFormat); sheet3->writeStr(22, 0, L"DATE(2010;3;11) = L", arFormat); sheet3->writeFormula(22, 1, L"DATE(2010;3;11)", alignDateFormat); sheet3->writeStr(23, 0, L"DAY(B23) = L", arFormat); sheet3->writeFormula(23, 1, L"DAY(B23)", alFormat); sheet3->writeStr(24, 0, L"MONTH(B23) = L", arFormat); sheet3->writeFormula(24, 1, L"MONTH(B23)", alFormat); sheet3->writeStr(25, 0, L"YEAR(B23) = L", arFormat); sheet3->writeFormula(25, 1, L"YEAR(B23)", alFormat); sheet3->writeStr(26, 0, L"DAYS360(B23;TODAY()) = L", arFormat); sheet3->writeFormula(26, 1, L"DAYS360(B23;TODAY())", alFormat); sheet3->writeStr(28, 0, L"B3+100*(2-COS(0)) = L", arFormat); sheet3->writeFormula(28, 1, L"B3+100*(2-COS(0))", alFormat); sheet3->writeStr(29, 0, L"ISNUMBER(B29) = L", arFormat); sheet3->writeFormula(29, 1, L"ISNUMBER(B29)", alFormat); sheet3->writeStr(30, 0, L"AND(1;0) = L", arFormat); sheet3->writeFormula(30, 1, L"AND(1;0)", alFormat); sheet3->writeStr(32, 0, L"HYPERLINK() = L", arFormat); sheet3->writeFormula(32, 1, L"HYPERLINK(\"http://www.libxl.com\")", linkFormat); } Sheet* sheet4 = book->addSheet(L"aligning-colors-borders"); if(sheet4) { sheet4->setDisplayGridlines(false); sheet4->setCol(1, 1, 30); sheet4->setCol(3, 3, 11.4); sheet4->setCol(4, 4, 2); sheet4->setCol(5, 5, 15); sheet4->setCol(6, 6, 2); sheet4->setCol(7, 7, 15.4); const wchar_t* nameAlignH[] = {L"ALIGNH_LEFT", L"ALIGNH_CENTER", L"ALIGNH_RIGHT"}; AlignH alignH[] = {ALIGNH_LEFT, ALIGNH_CENTER, ALIGNH_RIGHT}; for(int i = 0; i < sizeof(nameAlignH) / sizeof(const wchar_t*); ++i) { Format* format = book->addFormat(); format->setAlignH(alignH[i]); format->setBorder(); sheet4->writeStr(i * 2 + 2, 1, n

资源文件列表:

libxl-4.0.3.zip 大约有27个文件
  1. libxl-4.0.3/
  2. libxl-4.0.3/.sconsign.dblite 2.71KB
  3. libxl-4.0.3/SConstruct 575B
  4. libxl-4.0.3/demo.cpp 15.4KB
  5. libxl-4.0.3/img/
  6. libxl-4.0.3/img/heart.jpg 2.51KB
  7. libxl-4.0.3/include/
  8. libxl-4.0.3/include/libxl.h 2.81KB
  9. libxl-4.0.3/include/libxl_IAutoFilterT.h 1.97KB
  10. libxl-4.0.3/include/libxl_IBookT.h 6.34KB
  11. libxl-4.0.3/include/libxl_IFilterColumnT.h 1.95KB
  12. libxl-4.0.3/include/libxl_IFontT.h 2.21KB
  13. libxl-4.0.3/include/libxl_IFormControlT.h 4.15KB
  14. libxl-4.0.3/include/libxl_IFormatT.h 4.93KB
  15. libxl-4.0.3/include/libxl_IRichStringT.h 1.53KB
  16. libxl-4.0.3/include/libxl_ISheetT.h 17.03KB
  17. libxl-4.0.3/include/libxl_enum.h 10.56KB
  18. libxl-4.0.3/include/libxl_setup.h 1.56KB
  19. libxl-4.0.3/lib/
  20. libxl-4.0.3/lib/libxl.dll 8.29MB
  21. libxl-4.0.3/lib/libxl.lib 157.25KB
  22. libxl-4.0.3/lib/libxl.so 25.58MB
  23. libxl-4.0.3/makefile 189B
  24. libxl-4.0.3/unicode_demo/
  25. libxl-4.0.3/unicode_demo/SConstruct 616B
  26. libxl-4.0.3/unicode_demo/demo.cpp 15.56KB
  27. libxl-4.0.3/unicode_demo/makefile 209B
0评论
提交 加载更多评论
其他资源 基于STM32H7VBT6的六足机器人控制代码
六足机器人的实时控制代码是实现机器人精确运动和环境适应性的关键。这些代码通常涉及到运动学、动力学、轨迹规划、PID控制等多个方面。在实时控制中,代码需要能够快速响应环境变化,并实时调整机器人的运动参数以保持稳定性和效率。为了提高实时性和适应性,控制代码可能会采用自适应控制策略,如基于多模态切换的自适应控制,这种策略能够根据环境变化自动调整机器人的运动模式。此外,代码可能还会集成模糊逻辑或神经网络等智能控制方法,以提高对复杂环境的适应能力。 实时控制代码的编写和优化是一个不断迭代的过程,需要根据实验结果和实际应用场景进行调整。通过不断的测试和验证,控制代码能够更好地满足六足机器人在各种环境下的运动控制需求。
deep-sort-pytorch
多目标跟踪算法
MVsB1_BT_Audio_SDK_v0.3.2.zip
MVsB1_BT_Audio_SDK_v0.3.2.zip
BP神经网络模型Python代码分享给需要的同学
BP神经网络模型Python代码分享给需要的同学
Pro Git免费开源书籍
"Pro Git" 是一本全面介绍Git版本控制系统使用的免费书籍,由Scott Chacon和Ben Straub编写,并由Apress出版社出版。这本书适合Git的新手以及有经验的用户,它不仅覆盖了Git的基础知识,还深入探讨了Git的高级特性,是学习Git的一个非常好的资源。 主要章节概览: 1. 入门:提供Git的基本介绍,包括安装Git以及如何创建和克隆仓库 2. Git基础:讲解如何使用Git进行日常的工作流程,包括提交更改、查看历史记录、撤销更改等 3. 分支管理:讲解如何使用Git进行日常的工作流程,包括提交更改、查看历史记录、撤销更改等 4. 服务端Git:涉及设置和管理Git服务器的内容; 5. Git工具:探讨一些有用的Git工具,比如图形界面客户端和补丁管理工具 ..... 这本书的优点之一就是它的实用性。每个概念都通过实际例子来说明,并且提供了一系列的提示和技巧,帮助读者更好地理解Git的工作方式。此外,书中也包含了对常见问题的解答,以及如何解决常见的错误。
Pro Git免费开源书籍 Pro Git免费开源书籍 Pro Git免费开源书籍
OpenStack自动化部署shell脚本,非Ansible
OpenStack自动化部署shell脚本,非Ansible 使用shell脚本编写
2023级学生暑期社会调查活动相关材料.zip
2023级学生暑期社会调查活动相关材料.zip
Depot-Management-Programe-main.zip
Depot-Management-Programe-main.zip