public void OriginCode(string guid, int pointsPositionId, string dataType) { object obj = CacheHelper.GetCache(guid); if (obj == null) { throw new ApplicationException("guid invalid"); } var ms = _fileConverter.GetStream(obj); string preFileName = GetDownloadPreFileNameByTestTypeId(pointsPositionId, dataType); Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}.xls", preFileName)); Response.BinaryWrite(ms.ToArray()); ms.Close(); ms.Dispose(); CacheHelper.RemoveAllCache(guid); }
public void OriginCode(string guid, string ReportName) { object obj = CacheHelper.GetCache(guid); if (obj == null) { throw new ApplicationException("guid invalid"); } var ms = _fileConverter.GetStream(obj); string preFileName = "一级安全评估报告"; string DownloadName = string.Concat(ReportName, preFileName); Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}.docx", DownloadName)); Response.BinaryWrite(ms.ToArray()); ms.Close(); ms.Dispose(); CacheHelper.RemoveAllCache(guid); }