zoukankan      html  css  js  c++  java
  • Aspose,学习笔记

    这几天碰到一个需求就是导出到Excel文件

    用到Aspose

    //Create a workbook object
            Workbook workbook = new Workbook(path);
      
    
            //Get the first worksheet in the workbook
            Worksheet worksheet = workbook.Worksheets[0];
    
            //Get the cells collection in the sheet
            Cells cells = worksheet.Cells;
    
            //Put a string value into the cell using its name
            cells["A1"].PutValue("Cell Value");
    
            //put a string value into the cell using its name
            cells["A2"].PutValue("Hello World");
            ////Save file and send to client browser using selected format
           workbook.Save(HttpContext.Current.Response, "HelloWorld.xls", ContentDisposition.Attachment, new XlsSaveOptions(SaveFormat.Excel97To2003));
     
            //end response to avoid unneeded html
            HttpContext.Current.Response.End();      
  • 相关阅读:
    Server Profiler
    Unit Test with VS.NET
    js解析json字符
    多维数组
    $routeProvider与$stateProvider区别
    post 与get
    gulp配置
    homebrew常用指令
    less.js
    过滤器
  • 原文地址:https://www.cnblogs.com/MyFlora/p/2445235.html
Copyright © 2011-2022 走看看