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


 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[0];
            sheet.Cells[0, 0].PutValue(1);
            if (Response != null)
            {
                // Save in Xlsx format
                workbook.Save(Response, "test.xlsx", ContentDisposition.Attachment, new OoxmlSaveOptions());
                Response.End();
            }
        }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM