其他分享
首页 > 其他分享> > 导出execl

导出execl

作者:互联网

 

api层

//导出Excel项目关联合同
[HttpGet]
public IActionResult ExportContract()
{
var list = _hongDal.GetProject(1, 3, "", "", "", 0, 0);
var meno = new MemoryStream();
meno.SaveAs(list.PageData);
meno.Seek(0, SeekOrigin.Begin);
return new FileStreamResult(meno, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
{
FileDownloadName = "demo.xlsx"
};
}

vue

 location.href=`http://localhost:24310/api/Server/ExportContract`;

 

标签:execl,api,list,导出,ExportContract,meno,var,new
来源: https://www.cnblogs.com/lt0222/p/15726641.html