简体   繁体   English

在 c# 中的 Excel 中添加单元格形成

[英]Adding Cell Formating in Excel in c#

I have exported html contents into excel using below code.我已使用以下代码将 html 内容导出到 excel 中。

 protected void ExportToExcelButton_Click(object sender, EventArgs e)
    {
        Response.AppendHeader("content-disposition", "attachment;filename=ExportedHtml.xls");
        Response.Charset = "";
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.ContentType = "application/vnd.ms-excel";
        this.EnableViewState = false;
        Response.Write(ExportDiv.InnerHtml);
        Response.End();

    }

excel sheet is below excel 表如下

下面是excel表

Now I need to do excel cell format for the cells date, id using c#现在我需要为单元格日期执行 excel 单元格格式,id 使用 c#

How to do excel cell format using c#如何使用 c# 执行 excel 单元格格式

My advise is to use ClosedXML.我的建议是使用 ClosedXML。 Well-described documentation, a large community.描述良好的文档,庞大的社区。 I myself have worked quite a lot with this library.我自己在这个库上做了很多工作。 I recommend it.我推荐它。

Here is the link .这是链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM