public FileContentResult DownloadExcelFile(Guid sessionId, Int32 specId) { F1Model m = new F1Model(sessionId, specId); Byte[] buff = NskdExcel.ToExcel(sessionId, m.Table_dt, m.Head_dt); String fileName = null; try { fileName = (String)m.Head_dt.Rows[0]["номер_извещения_аукциона"]; } catch (Exception) { } if (String.IsNullOrWhiteSpace(fileName)) { fileName = specId.ToString(); } if (String.IsNullOrWhiteSpace(fileName)) { fileName = DateTime.Now.Date.ToString("yyyy-MM-dd HH:mm"); } fileName += ".xlsx"; FileContentResult f = File(buff, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName); return(f); }
public Object DownloadExcelFile() { Object v = "FNet.MDVReports.Controllers.F0Controller.DownloadExelFile()"; RequestPackage rqp = new RequestPackage { SessionId = new Guid() }; F0Model m = new F0Model(rqp); Byte[] buff = NskdExcel.ToExcel(m.Data); String fileName = "MDVReport1 " + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + ".xlsx"; FileContentResult fcr = File(buff, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName); v = fcr; return(v); }