Пример #1
0
        public ActionResult Report(Department department)
        {
            DeptReport deptreport = new DeptReport();

            byte[] abytes = deptreport.PrepareReport(exportToPdf());
            return(File(abytes, "application/pdf"));
        }
Пример #2
0
        public async Task <ActionResult> exportPDF()
        {
            DeptReport dept     = new DeptReport();
            var        readTask = await GetDept();

            byte[] abytes = dept.PrepareReport(readTask);
            return(File(abytes, "application/pdf", $"Department Report ({DateTime.Now.ToString("hh:mm:ss dd/MM/yyyy")}).pdf"));
        }