public static void DownExcelData(this Page thispage,DataTable dataTable,string title)
{
Workbook wb = new Workbook();
wb.Worksheets.Clear();
wb.Worksheets.Add(SheetType.Worksheet);
var ws = wb.Worksheets[0];
ws.Name = title;
ws.Cells.ImportDataTable(dataTable, true, "A1");
var m = wb.SaveToStream();
var buff = m.ToArray();
var httpRenponse = System.Web.HttpContext.Current.Response;
httpRenponse.Clear();
httpRenponse.Charset = "GB2312";
httpRenponse.Buffer = true;
thispage.EnableViewState = false;
httpRenponse.ContentEncoding = System.Text.Encoding.Default;
httpRenponse.AppendHeader("Content-Disposition", string.Format("attachment;filename=" + System.Web.HttpUtility.UrlEncode(title + ".xls", Encoding.UTF8)));
thispage.Response.ContentType = "application/vnd.ms-excel";
httpRenponse.BinaryWrite(buff);
httpRenponse.Flush();
httpRenponse.Close();
httpRenponse.End();
}