ad
2006-04-29 20:54:11 UTC
€p§ÌŠ³€@ÓWeb Application ¥Î€U±ªºµ{Š¡, ±N€@ÓExcelÀÉ,°ešìClientºÝ
ŠýExcelÀÉ°e¥X«á, §Ú¥hÂI¿ï³oWeb applicationªºšä¥Šºô¶, ºô¶ªº€º®e³£ÅÜŠš¶ÃœX(€£¬O°e¥X¥hªºExcelÀÉÅܶÜX)
œÐ°Ý§ÚnŠpŠó³B²z©O?
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static void SendXlsToClient(Page MyPage, MemoryStream ms)
{
ms.Position = 0;
MyPage.Response.Clear();
MyPage.Response.AddHeader("Content-Disposition", "attachment;
filename=Test.xls");
MyPage.Response.AddHeader("Content-Length", ms.Length.ToString());
MyPage.Response.ContentType = "application/excel"; //octet-stream";
MyPage.Response.BinaryWrite(ms.GetBuffer());
MyPage.Response.End();
}
ŠýExcelÀÉ°e¥X«á, §Ú¥hÂI¿ï³oWeb applicationªºšä¥Šºô¶, ºô¶ªº€º®e³£ÅÜŠš¶ÃœX(€£¬O°e¥X¥hªºExcelÀÉÅܶÜX)
œÐ°Ý§ÚnŠpŠó³B²z©O?
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static void SendXlsToClient(Page MyPage, MemoryStream ms)
{
ms.Position = 0;
MyPage.Response.Clear();
MyPage.Response.AddHeader("Content-Disposition", "attachment;
filename=Test.xls");
MyPage.Response.AddHeader("Content-Length", ms.Length.ToString());
MyPage.Response.ContentType = "application/excel"; //octet-stream";
MyPage.Response.BinaryWrite(ms.GetBuffer());
MyPage.Response.End();
}