页面中数据保存成EXECEL,word等
来源:互联网 发布:行测做题软件 编辑:程序博客网 时间:2024/05/21 17:43
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htw = new HtmlTextWriter(sw);
Page page = new Page();
HtmlForm form = new HtmlForm();
GridView1.EnableViewState = false;
// Deshabilitar la validación de eventos, sólo asp.net 2
page.EnableEventValidation = false;
// Realiza las inicializaciones de la instancia de la clase Page que requieran los diseñadores RAD.
page.DesignerInitialize();
page.Controls.Add(form);
form.Controls.Add(GridView1);
page.RenderControl(htw);
Response.Clear();
Response.Buffer = true;
//Response.ContentType指定文件类型 可以为application/ms-excel、application/ms-word、application/ms-txt、application/ms-html 或其他浏览器可直接支持文档
Response.ContentType = "application/vnd.ms-excel";
//下面这行很重要, attachment 参数表示作为附件下载,您可以改成 online在线打开
//filename=FileFlow.xls 指定输出文件的名称,注意其扩展名和指定文件类型相符,可以为:.doc .xls .txt .htm
Response.AddHeader("Content-Disposition", "attachment;filename=data.xls");
Response.Charset = "UTF-8";
Response.ContentEncoding = Encoding.Default;
Response.Write(sb.ToString());
Response.End();
- 页面中数据保存成EXECEL,word等
- ThinkPHP 导出数据到Execel文件中
- 如何将Execel转换成word并加入其他内容
- vb中MSFlexGrid控件中的数据导出到execel中
- SSH框架中数据库数据生成execel表格提供下载
- 将mysql中数据导出到execel表
- 将mysql中数据导进到execel表xc8147
- 生成word、execel、pdf文件
- 将页面保存到 word
- 用jxl来实现将数据导出成EXECEL表
- asp 中数据导出为 word ,excl ,text ,等格式文件
- 保存网页数据到WORD
- js 保存页面数据
- WORD中储存vba代码,把excel数据写入word并保存。
- php读取word\pdf等文档的内容,并将其保存到网页中
- 将页面上数据保存到excel中
- [转载]在HTML页面转为WORD保存
- web项目页面保存为word文件
- oracle用户管理
- codeforces 3C Tic-tac-toe
- 巧妙喝水打败多种疾病
- 对象简介
- 小心别让孩子养成暴力习惯[图]
- 页面中数据保存成EXECEL,word等
- 第四周作业——图的表示
- Http1.1 请求 响应
- Java华丽转身——浅识J2EE十三标准
- 面试-SERVLET API中forward()与redirect()的区别
- 关于网络营销团队组建的一些思路
- 四种解决Win8.1系统中IE10/IE11浏览器Flash不能显示技巧
- POJ 2155 Matrix (二维树状数组+经典题)
- 换工作,让我里外不是人,到底错在哪儿