导出Excel(npoi)
来源:互联网 发布:cda数据分析师认证 编辑:程序博客网 时间:2024/05/16 11:59
public static void ExportExcel(DataTable dt, string fileName = "") { //生成Excel IWorkbook book = BuildWorkbook(dt); //web 下载 if (fileName == "") fileName = string.Format("{0:yyyyMMddHHmmssffff}", DateTime.Now); fileName = fileName.Trim(); string ext = Path.GetExtension(fileName); if (ext.ToLower() == ".xls" || ext.ToLower() == ".xlsx") fileName = fileName.Replace(ext, string.Empty); HttpResponse httpResponse = HttpContext.Current.Response; httpResponse.Clear(); httpResponse.Buffer = true; httpResponse.Charset = Encoding.UTF8.BodyName; httpResponse.AppendHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls"); httpResponse.ContentEncoding = Encoding.UTF8; httpResponse.ContentType = "application/vnd.ms-excel; charset=UTF-8"; book.Write(httpResponse.OutputStream); httpResponse.End(); }
0 0
- 导出Excel(npoi)
- Npoi导出excel整理(附源码)
- Npoi导出excel整理(附源码)
- NPOI导出Excel(异步请求)
- Npoi导出excel整理(附源码)
- Npoi导出excel整理(附源码)
- NPOI导出Excel
- 利用npoi导出excel
- NPOI导出Excel
- NPOI Excel导入导出
- 使用NPOI导出EXCEL
- NPOI导出excel
- 利用npoi导出excel
- NPOI导出Excel功能
- npoi导出到EXCEL
- NPOI导出Excel
- NPOI实现EXCEL导出
- NPOI导出到Excel
- Python轻松入门-12 函数
- Codeforces Mahmoud and a Triangle (水
- 我现在要改变观念-不是按月,而是按项目给钱了。
- Linux下查看tomcat日志及乱码解决方案
- ICLR 2017 | Attention 和 Memory Networks
- 导出Excel(npoi)
- NIPS 2016 | Best Paper, Dual Learning, Review Network, VQA 等论文选介
- golang实时消息平台NSQ的使用
- Uboot2016 for tiny4412调试
- ACL 2016 | Modeling Coverage for Neural Machine Translation
- ACL 2016 | CopyNet 和 Pointer Softmax
- irq change
- 干货 | 你真的了解 Convolutional Neural Networks 么
- 干货 | Generative Adversarial Networks(GAN)的现有工作