public FileResult DownloadFile(string Param, string ReportType) { DocumentDownloadSection data = JsonConvert.DeserializeObject <DocumentDownloadSection>(Param); DataSet ds = _objBLL.GetDataForReport(data, Session["EMP_ID"].ToString()); var rf = ReportFormat.getReport(ReportType, ds, data); Response.Buffer = false; Response.ClearContent(); Response.ClearHeaders(); return(File(rf.stream, "application/pdf", data.OperationName + DateTime.Now.ToString("dd-MM-yyyy hhmm") + ".pdf")); }
public FileResult OpenFile(string Param, string ReportType) { try { DocumentDownloadSection data = JsonConvert.DeserializeObject <DocumentDownloadSection>(Param); DataSet ds = _objBLL.GetDataForReport(data, Session["EMP_ID"].ToString()); var rf = ReportFormat.getReport(ReportType, ds, data); return(File(rf.stream, rf.mimeType)); } catch (Exception ex) { Response.Write(ex.ToString()); } return(null); }