zoukankan      html  css  js  c++  java
  • sheet

      DataTable dt = bbbll.GetListPageStoreProcedure(1, 10000, "[user],wallet,user2", strwhere, "level_Id desc", selectdate, out Counts);

               HSSFWorkbook workbook = new HSSFWorkbook();//创建工作表
               HSSFSheet sheet=  workbook.CreateSheet("第一页");//
               HSSFRow rowhead = sheet.CreateRow(0);
               rowhead.CreateCell(0).SetCellValue("时间");
               rowhead.CreateCell(1).SetCellValue("会员姓名");
               rowhead.CreateCell(2).SetCellValue("注册会员");
               rowhead.CreateCell(3).SetCellValue("会员等级");
               //rowhead.CreateCell(4).SetCellValue("经手人");
               rowhead.CreateCell(4).SetCellValue("直推人");
               rowhead.CreateCell(5).SetCellValue("安置人");
               rowhead.CreateCell(6).SetCellValue("领导奖");
               rowhead.CreateCell(7).SetCellValue("直推奖");
               rowhead.CreateCell(8).SetCellValue("碰值奖");

               for (int rowindex = 1; rowindex <= dt.Rows.Count; rowindex++)
               {
                   HSSFRow row = sheet.CreateRow(rowindex);
                   for (int cellindex = 0; cellindex < 9; cellindex++)
                   {
                      row.CreateCell(cellindex).SetCellValue(dt.Rows[rowindex-1][cellindex].ToString());


                   }
               }
               //创建一个文档流对象
          

               using (FileStream fs = new FileStream(@"d:奖金资料.xls", FileMode.Create))
               {
                          
                   workbook.Write(fs); //将内存的文档对象写入到文档流中
               }
               MessageBox.Show(this, "下载成功放在d盘目录下");

  • 相关阅读:
    is_enable()、is_displayed()、isSelected()
    python selenium(常用关键字)
    Jenkins 构建 Jmeter 项目之源代码管理(SVN)
    Jenkins 构建 Jmeter 项目
    SAP SD基础知识之现金销售
    SAP SD基础知识之与FI集成相关的流程与配置
    SAP SD 基础知识之计划行类别(Schedule Line Category)
    SAP MM 事务代码MRKO触发的财务凭证不会出现在PO History里
    SAP MM 对于MRKO事务代码的几点优化建议
    SAP SD 销售中的借贷项凭证
  • 原文地址:https://www.cnblogs.com/cdaq/p/3457890.html
Copyright © 2011-2022 走看看