• 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;

  • 相关阅读:
    雨中梦游
    最后一次为你哭
    poj3169 Layout
    poj2253 Frogger
    钟爱一生
    POJ2668解题报告
    魅力泸西
    android学习笔记09(activity的生命周期)
    poj 3468 A Simple Problem with Integers
    android学习笔记之多线程(二)
  • 原文地址:https://www.cnblogs.com/ok519/p/6362487.html
Copyright © 2020-2023  润新知