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

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

導出GridView中的數據

導出GridView中的數據

LEATH 2018-12-06 12:01:27
我在導出GridView中的數據時用的是如下方法,但如果有圖片時,卻打印不出來,求高手解決一下, 怎么才能解決這個問題。我想了一下可能要把輸出流轉換成二進制流才可以。 ?protected void Button_print_Click(object sender, EventArgs e)??? {??????? System.Web.HttpContext HC = System.Web.HttpContext.Current;??????? HC.Response.Clear();??????? HC.Response.Charset = "GB2312";??????? HC.Response.Buffer = true;??????? HC.Response.ContentEncoding = System.Text.Encoding.UTF7;??????? HC.Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode("查詢結果打印", System.Text.Encoding.UTF8) + ".doc");??????? HC.Response.ContentType = "application/ms-word";//如果要打印為excel格式,則換為"application/excel"??????? this.EnableViewState = false;??????? System.IO.StringWriter sw = new System.IO.StringWriter();??????? System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);??????? this.GV_result.RenderControl(htw);??????? HC.Response.Write(sw.ToString());??????? HC.Response.End();??? }//打印輸出按鈕
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 325 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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