答案 0 :(得分:0)
这是我用来创建和下载docx文档的代码:
DocX g_document;
g_document = WhitePageReport(dt, dtSub);
MemoryStream ms = new MemoryStream();
g_document.SaveAs(ms);
Response.Clear();
Response.AddHeader("content-disposition", "attachment; filename=\"WhitePageReport.doc\"");
Response.ContentType = "application/msword";
ms.WriteTo(Response.OutputStream);
Response.End();