| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 655 人关注过本帖
标题:excel2007不能打开asp.net导出的excel
只看楼主 加入收藏
xRain
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2008-12-23
结帖率:100%
收藏
已结贴  问题点数:10 回复次数:2 
excel2007不能打开asp.net导出的excel
Response.Clear();
Response.Buffer = true;
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("test", Encoding.UTF8).ToString());
Response.ContentType = "application/ms-excel";
this.EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
GridView1.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();

利用以上代码导出excel后,07版的打不开,提示:“**的格式与文件的扩展名指定的格式不一致.........”

求解
搜索更多相关主题的帖子: false excel 
2012-02-03 11:04
xRain
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2008-12-23
收藏
得分:0 
怎么没人回应啊
2012-02-03 12:56
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:7 
这个只是生成excel文件的代码没有关于excel格式的信息。
2012-02-03 17:15
快速回复:excel2007不能打开asp.net导出的excel
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025273 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved