如何使用chrome通过mvc将.xlsx文件导出为excel。它适用于.xls的但不是原来的.xlsx导出到Excel .xlsx文件
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename= Estimate1.xlsx");
Response.ContentType = "application/excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
Response.Write(sw.ToString());
Response.End();
看看http://epplus.codeplex.com/ – user287107
我们在我们的一个项目中使用EPPlus,它的效果很好。 –
我还使用它,它的伟大工程有时也功能也一点点有限的,例如所有图表选项都不可用,或者如果写入超过1000000行,它不会返回错误。另外有时数字写错了方式,Excel然后抱怨破损的xls文件 – user287107