public ActionResult FoundryInvoicesReport(DateTime startDate, DateTime endDate, bool unscheduled) { var operationResult = new OperationResult(); MemoryStream ms = new MemoryStream(); try { ms = ReportingManager.CreateFoundryInvoicesReport(startDate, endDate, unscheduled); } catch (Exception ex) { operationResult.Message = "Error occured printing Foundry Invoices Report"; logger.ErrorFormat("Error occured printing Foundry Invoices Report: {0} ", ex.ToString()); this.AddNotification(operationResult.Message, NotificationType.ERROR); } return(new FileStreamResult(ms, "application/pdf")); }