亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

用GridViewt生成如下圖的表格,用C#

用GridViewt生成如下圖的表格,用C#

一只斗牛犬 2018-11-07 05:02:10
GridView gridview = new GridView();                gridview.DataSource = dt;                gridview.DataBind();                string filename = LevelSupBaseInfoDropDownList.SelectedItem.Text;                Response.Clear();                Response.Buffer = true;                Response.Charset = "GB2312";                Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlPathEncode(filename + ".xls"));                Response.ContentEncoding = System.Text.Encoding.UTF7;                Response.ContentType = "application/ms-excel";                System.IO.StringWriter oStringWriter = new System.IO.StringWriter();                System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);                gridview.RenderControl(oHtmlTextWriter);                Response.Output.Write(oStringWriter.ToString());                Response.Flush();                Response.End();
查看完整描述

2 回答

?
偶然的你

TA貢獻1841條經驗 獲得超3個贊

使用向客戶端輸出的js的方式,這個也可以任意指定樣式和格式。這個需要ie允許ActiveX

查看完整回答
反對 回復 2018-11-12
  • 2 回答
  • 0 關注
  • 540 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號