zoukankan      html  css  js  c++  java
  • Excel 출력

    NativeExcel

    참조 사이트 

    http://www.nika-soft.com/dwnld.htm  

    IWorkbook book = Factory.CreateWorkbook();

    lWorksheet sheet =book.worksheets.add();

    sheet.clls[1.1].value ="赋值";

    sheet.Cells[1, 1, 1, 24].Interior.Color = ColorTranslator.FromHtml("#C1CDC1");
    sheet.Cells[1, 1, 1, 24].RowHeight = 20;
    sheet.Cells[1, 1, 1, 24].HorizontalAlignment = XlHAlign.xlHAlignCenter;
    sheet.Cells[1, 1, 1, 24].VerticalAlignment = XlVAlign.xlVAlignCenter;

     处理数据

    sheet.Range[1, 1, count, 24].Borders[XlBordersIndex.xlInsideAll].Weight = XlBorderWeight.xlThin;
    sheet.Range[1, 1, count, 24].Borders[XlBordersIndex.xlAround].Weight = XlBorderWeight.xlThin;

    FileResult fr = null;
    using (System.IO.MemoryStream _MS = new System.IO.MemoryStream())
    {
    book .SaveAs(_MS);
    fr = base.File(new System.IO.MemoryStream(_MS.ToArray()), "application/excel", "fileName.xls");
    }

    Response.HeaderEncoding = System.Text.UnicodeEncoding.UTF8;
    Response.Charset = Response.HeaderEncoding.WebName;

    return _fr;

  • 相关阅读:
    小猫爬山
    方格取数
    Bash 脚本编程
    树链剖分学习笔记
    输入输出优化
    没有上司的舞会
    线性dp 之 麻烦的聚餐
    飞翔
    挖地雷
    The Prices
  • 原文地址:https://www.cnblogs.com/ok519/p/6362487.html
Copyright © 2011-2022 走看看