我正在尝试将使用 EPPLUS 创建的 ExcelPackage 输出到文件路径,而 Excel 不会实际打开文件。我现在有下面的代码......我做错了什么?谢谢。
Dim FileName As String = "C:\Temp\" + CurrAcct + ".xlsx"
Dim Result As New MemoryStream()
xlPackage.SaveAs(Result)
Context.Response.Clear()
Context.Response.ContentType = "application/vnd.openxmlformats- officedocument.spreadsheetml.sheet"
Context.Response.AddHeader("Content-Disposition", "attachment;filename=" + FileName + ".xlsx")
Result.WriteTo(Context.Response.OutputStream)
Context.Response.End()