62,047
社区成员
发帖
与我相关
我的任务
分享
window.location.href = top.$.rootUrl + '/FK_QualityManage/Basic_Material/PrintLabel?BM_Model=' +
BM_Model + '&Count=' + Count + '&BM_Code='+BM_Code;
public ActionResult PrintLabel(string BM_Model, string Count,string BM_Code)
{
Stream ms = new MemoryStream();
ms = basic_MaterialIBLL.PrintLabel(BM_Model, Count, BM_Code);
if (ms != null)
{
return File(ms, "application/ms-excel", "Label.xls");
}
else
{
return Fail("打印失败!");
}
}
using (var exportData = new MemoryStream())
{
Response.Clear();
Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
Response.AddHeader("content-disposition", "attachment;filename=" + fileName + ".xlsx");
workbook.Write(exportData);
Response.BinaryWrite(exportData.ToArray());
Response.End();
}