您的位置:首页 > 其它

excel导出_自己定义内容

2014-07-24 12:55 183 查看
m_outPutJS= InitOutPutContent(isession, json); 输出内容

FileName = InitFileName(); 文件名称

HttpResponse resp = HttpContext.Current.Response;

resp.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");

resp.HeaderEncoding = System.Text.Encoding.GetEncoding("GB2312");

resp.AppendHeader("Content-Disposition", "attachment;filename=" +this.FileName+ ".xls");

resp.Write("<meta http-equiv=Content-Type content=\"text/html; charset=GB2312\">");

resp.ContentType = "application/ms-excel";//设置输出文件类型为excel文件。

resp.Write(m_outPutJS);

//写缓冲区中的数据到HTTP头文件中

// HttpContext.Current.ApplicationInstance.CompleteRequest();

resp.End();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: