我有包含2個gridview和2個mschart的頁面。我想將此頁面導出爲excel。爲了這個目的,我把這些控件到面板和編寫代碼:當此代碼運行,一切都只是圖表確定將包含圖像的頁面導出到Excel中
Response.Clear();
Response.ContentType = "application/vnd.msexcel";
Response.AddHeader("content-disposition", "attachment; filename=rapor.xls");
Response.ContentEncoding = System.Text.Encoding.Default;
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
panel1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
。他們不會出色。我該怎麼做?