Response.Clear();
Response.Buffer = true;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + DateTime.Now.ToString("SALESPLANyyyyMMddHHmmss")+ ".xls");
Response.ContentEncoding = System.Text.Encoding.GetEncoding("big5");
Response.ContentType = "application/ms-excel";
this.EnableViewState = false;
System.Globalization.CultureInfo myCItrad = new System.Globalization.CultureInfo("ZH-TW", true);
System.IO.StringWriter oStringWriter = new System.IO.StringWriter(myCItrad);
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
scrollDiv.RenderControl(oHtmlTextWriter);
Response.Charset = "big5";
string ss = oStringWriter.ToString().Replace("</tr>", "/r/n");
ss = ss.ToString().Replace("</td>", "/t");
Response.Write(Regex.Replace( ss.Replace("全選", "").Replace(" ", ""), @"<[^>]+>|</[^>]+>", ""));
Response.End();
Response.Buffer = true;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + DateTime.Now.ToString("SALESPLANyyyyMMddHHmmss")+ ".xls");
Response.ContentEncoding = System.Text.Encoding.GetEncoding("big5");
Response.ContentType = "application/ms-excel";
this.EnableViewState = false;
System.Globalization.CultureInfo myCItrad = new System.Globalization.CultureInfo("ZH-TW", true);
System.IO.StringWriter oStringWriter = new System.IO.StringWriter(myCItrad);
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
scrollDiv.RenderControl(oHtmlTextWriter);
Response.Charset = "big5";
string ss = oStringWriter.ToString().Replace("</tr>", "/r/n");
ss = ss.ToString().Replace("</td>", "/t");
Response.Write(Regex.Replace( ss.Replace("全選", "").Replace(" ", ""), @"<[^>]+>|</[^>]+>", ""));
Response.End();