asp.net mvc用aspose.cells 导出xlsx格式的excel。无残留

寻技术 ASP.NET编程 / 其他编程 2023年07月11日 111
 public void Export()
        {
            HttpResponse Response = System.Web.HttpContext.Current.Response;
            // Load your source workbook
            Workbook workbook = new Workbook(); // Creating a Workbook object
            var sheet = workbook.Worksheets[];
            sheet.Cells[, ].PutValue();
            if (Response != null)
            {
                // Save in Xlsx format
                workbook.Save(Response, "test.xlsx", ContentDisposition.Attachment, new OoxmlSaveOptions());
                Response.End();
            }
        }

 

关闭

用微信“扫一扫”