码迷,mamicode.com
首页 > 其他好文 > 详细

epplus输出成thml

时间:2018-12-01 23:37:25      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:test   pen   res   load   space   github   ace   extension   cte   

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OfficeOpenXml;
using System.IO;
using EPPlus.Html;
namespace testepplus
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string zpath = Server.MapPath("/") + "test1.xlsx";
            FileInfo zfile = new FileInfo(zpath);

            using (ExcelPackage excel = new ExcelPackage(zfile,"123"))
            {
                //excel.SaveAs(new FileInfo(Server.MapPath("/") + "test1.xlsx"), "123");
                Response.Write(EPPlus.Html.EPPlusExtensions.ToHtml(excel.Workbook.Worksheets[3]));

            }

        }
    }
}

 

 

fx要4.5+ ,需要huget package  epplus ,epplus.html   

 

可以从https://github.com/fitogram/EPPlus.Html 下载源码更改fx为4.0

 

epplus.html 0.20版本不支持excel里的图片

epplus输出成thml

标签:test   pen   res   load   space   github   ace   extension   cte   

原文地址:https://www.cnblogs.com/coolyylu/p/10051333.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!