c# - XML Errors using EPPlus to download Excel file in MVC -
here important part, called ajax call in view:
using (excelpackage pck = new excelpackage()) { excelworksheet ws = pck.workbook.worksheets.add(filename); ws.cells["a1"].loadfromdatatable(dt, true); response.contenttype = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; response.addheader("content-disposition", "attachment; filename=" + filename + ".xlsx"); byte[] bytes = pck.getasbytearray(); response.binarywrite(bytes); response.end(); }
but creates error:
any idea wrong?
Comments
Post a Comment