找回密码
 注册
搜索
热搜: java php web
查看: 218|回复: 7

[未解决] GridView导入数据到Excel

[复制链接]
发表于 2009-11-12 22:53:22 | 显示全部楼层 |阅读模式
我将GridView中的数据导入到Excel中的时候用的是如下这段代码
private void ExportOne(string FileType, string FileName)
    {
        Response.Charset = "GB2312";
        Response.ContentEncoding = System.Text.Encoding.UTF8;
        Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(FileName, Encoding.UTF8).ToString());
        Response.ContentType = FileType;
        this.EnableViewState = false;
        StringWriter tw = new StringWriter();
        HtmlTextWriter hw = new HtmlTextWriter(tw);
        
        gv.RenderControl(hw);
        Response.Write(tw.ToString());
        Response.End();
    }
public override void VerifyRenderingInServerForm(Control control)
    {

    }
   但是当GridView中的数据有加密过的数据的话,会导致所有数据都导不出来,不知道这是问什么。
发表于 2009-11-13 23:53:37 | 显示全部楼层
不晓得哎,帮你顶下。

评分

1

查看全部评分

回复

使用道具 举报

 楼主| 发表于 2009-11-21 12:39:52 | 显示全部楼层
这个问题,困扰了很久,还是不知道怎么解决
回复

使用道具 举报

发表于 2009-11-24 15:44:27 | 显示全部楼层
GridView中有加密数据?还没遇到过啊,测试一下!!
回复

使用道具 举报

发表于 2009-11-25 16:29:57 | 显示全部楼层
新人报道,过来学习。。。。。
回复

使用道具 举报

 楼主| 发表于 2009-11-25 20:18:13 | 显示全部楼层
没有搭理!!!!
回复

使用道具 举报

 楼主| 发表于 2009-11-25 20:19:29 | 显示全部楼层
算了 在顶一次结贴算了。。。
回复

使用道具 举报

发表于 2009-12-3 14:27:28 | 显示全部楼层
网上有》》》》》》》》》》》》》》》
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|软晨网(RuanChen.com)

GMT+8, 2024-9-20 13:36

Powered by Discuz! X3.5

Copyright © 2001-2023 Tencent Cloud.

快速回复 返回顶部 返回列表