qt 使用xlslib操作execl

  • Post author:
  • Post category:其他


下载路径http://sourceforge.net/projects/xlslib/files/

QT配置PATH路径,加LIB库

path = path+tr(“/report.xls”);

workbook wb;

xf_t* xf = wb.xformat();

worksheet* ws;

ws = wb.sheet(“报警记录”);

string label = “编号”;

ws->label(0,0,”编号”,xf);    // 从0开始数,第1行,第2列,即C3

ws->label(0,1,”报警地点”,xf);

ws->label(0,2,”报警时间”,xf);

ws->label(0,3,”报警类型”,xf);

ws->label(0,4,”报警等级”,xf);

ws->label(0,5,”处理人”,xf);

ws->label(0,6,”处理方式”,xf);

ws->label(0,7,”处理结果”,xf);

wb.Dump(path.toStdString().c_str());



版权声明:本文为du_bingbing原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。