public ActionResult ExportPdf(string courierId, string fromDate, string toDate, string displayName) { var queryInfo = new DriverReportQueryInfo { CourierId = Convert.ToInt32(courierId), FromDate = Convert.ToDateTime(fromDate), ToDate = Convert.ToDateTime(toDate), DisplayName = displayName.ToUpper() }; var destPath = _localPath; var fileName = string.Format("DriverReport_{0}.pdf", DateTime.Now.ToString("yyyyMMddss")); destPath = Path.Combine(destPath, fileName); destPath = _systemPrintPdfService.ExportDriverReport(destPath, queryInfo); var fileInfo = new FileInfo(destPath); if (fileInfo.Exists) { return(View(new DriverReportPdfViewModel { Path = _savedPath, FileName = fileInfo.Name })); } throw new Exception("No Report"); }
public string ExportDriverReport(string desPath, DriverReportQueryInfo queryInfo) { var html = string.Format(htmlFormat, GetContentRequestReport(queryInfo.CourierId, queryInfo.FromDate, queryInfo.ToDate, queryInfo.DisplayName)); var resultPath = _exportToPath(desPath, html); var resultByte = FileHelper.GetBytesFromFile(resultPath); var signeds = new List <byte[]> { resultByte }; signeds.CombineMultiplePdfsByByteAndExport(resultPath); return(resultPath); }