返回首页

您好,

我在这里开发Web应用程序和我有GridView和Excel工作表的GridView有相同的列名,我想领域名称的girdview gridview的内容导出到Excel工作表,请帮助我的朋友,

回答

评论会员:游客 时间:2012/02/07
乌玛・尚卡尔帕特尔:试试这个工具imgsrc=
member60
评论会员:游客 时间:2012/02/07
通过谷歌firsr冲浪的习惯,让它成为reffer,下面的,它可以帮助你:'{A}{A2}{A3的}{A4纸}]
| ManavGuru:你应该使用这种方法对您的exceldownload按钮的Click事件
 public void excelgridview()

 

{

 

        Response.Clear();

 

        Response.AddHeader("content-disposition", "attachment; filename=FileName.xls");

 

        Response.Charset = "";

 

        // If you want the option to open the Excel file without saving than



        // comment out the line below



        // Response.Cache.SetCacheability(HttpCacheability.NoCache);



        Response.ContentType = "application/vnd.xls";

 

        System.IO.StringWriter stringWrite = new System.IO.StringWriter();

 

        System.Web.UI.HtmlTextWriter htmlWrite =

        new HtmlTextWriter(stringWrite);

 

        GridView1.RenderControl(htmlWrite);

 

        Response.Write(stringWrite.ToString());

 

        Response.End();

 

    }

 

    public override void VerifyRenderingInServerForm(System.Web.UI.Control control)

    {

 

        // Confirms that an HtmlForm control is rendered for the

        //  specified ASP.NET server control at run time.



    }
评论会员:srinivasvadepally 时间:2012/02/07
喜Vivek,
{A5的}
{A6的}]
评论会员:阿赫亚virkar 时间:2012/02/07
{C}试试这个
刚刚通过的名称,DataGrid的调用此函数。
这可能会帮助你!RaviRanjankr
评论会员:游客 时间:2012/02/07
谷歌,请{A7的}更好的搜索在谷歌第一,尽量使方案。请尝试恢复的具体问题:RaviRanjankr。||这个问题很简单:codeprelang="C++"spanclass="code-keyword"int/span*value=newspanclass="code-keyword"int/span();*value=4;list.push_back(spanclass="code-keyword"value/span);/pre/code使副本的指针,因此,它不更新在for循环。解决方案(简单易用):{体C3}请记住,当你在一个向量指针到一个项目,你不应该添加更多的项目,因为再分配,除非你调用储备(预留空间)