public virtual FileResult ESGReportDownload(string operationNumber, ReportsESGReportViewModel viewmodel, OutputFormatEnum formatType) { bool regional; var columnDelimiter = Request.Form["ColumnDelimiter"]; if (columnDelimiter == "T") { columnDelimiter = "\t"; } viewmodel.Country = IsRegional(viewmodel.Country, out regional); var response = _reportingService.ExportESGReportToFile(viewmodel, OutputFormatEnum.Excel, columnDelimiter, regional); if (!response.IsValid) { return(null); } var OnDate = System.DateTime.Now.ToString("yyyyMMdd"); var OnHour = System.DateTime.Now.ToString("HHmm"); var MiFecha = OnDate + "_" + OnHour; if (formatType == OutputFormatEnum.Excel) { return(File(response.File, FileContentTypeEnum.Csv.GetEnumDescription(), "ESG_Report_" + MiFecha + ".csv")); } else if (formatType == OutputFormatEnum.PDF) { return(File(response.File, FileContentTypeEnum.Pdf.GetEnumDescription(), "ESG_Report_" + MiFecha + ".pdf")); } else { return(null); } }
public virtual ReportsESGReportViewModel GetReportsESGReportViewModel(string operationNumber) { var esgReportViewModel = new ReportsESGReportViewModel(); SetViewBagReportsESGReport(); return(esgReportViewModel); }