public ActionResult InvoiceRegisterReport(ReportViewModel model) { var operationResult = new OperationResult(); MemoryStream ms = new MemoryStream(); try { if (model.Condition == "International") { ms = ReportingManager.CreateInvoiceRegisterReportForInternational(model.StartDate, model.EndDate, model.ShipCode); } else if (model.Condition == "Domestic") { ms = ReportingManager.CreateInvoiceRegisterReportForDomestic(model.StartDate, model.EndDate, model.ShipCode); } } catch (Exception ex) { operationResult.Message = "Error occured printing Invoice Register Report"; logger.ErrorFormat("Error occured printing Invoice Register Report: {0} ", ex.ToString()); this.AddNotification(operationResult.Message, NotificationType.ERROR); } return(new FileStreamResult(ms, "application/pdf")); }