0
當我將動態創建的html表導出爲excel時,出現錯誤。錯誤說在asp.net c中導出爲excel時出錯#
Missing File: ~\Temporary Internet Files\Content.IE5\style.css.
當我說好的話,Excel的打開與瀏覽器上顯示的數據。不知道哪裏出錯。以下是Excel導出的代碼。
Response.ContentType = "application/x-msexcel";
Response.Clear();
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.AddHeader("Content-Disposition", "attachment; filename=ExcelFilenew.xls");
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
HtmlTbl.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();