您的位置:首页 > 其它

DataGrid 控件导出到Excel

2007-05-20 12:05 309 查看
Response.Clear();
Response.Buffer=true;
Response.ContentType="application/vnd.ms-excel";
Response.Charset="";
this.EnableViewState=false;

stringwriter  sw=new  stringwriter();
HtmlTextWriter  htw=new  HtmlTextWriter(sw);
YoueDataGrid.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();

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