public PartialViewResult _GetEPAssignmentScoringRDLCData(SearchEPAssignmentScoringParams search, Email emailInput, string ReportType = "Summary") { ReportViewer reportViewer = new ReportViewer(); try { if (String.IsNullOrEmpty(search.ScoreValueList)) { search.ScoreValueList = ""; } var findingsService = new EPAssignmentScoring(); if (emailInput.To != null) { ViewBag.FromEmail = true; ViewBag.FromEmailSuccess = WebConstants.Email_Success; } reportViewer = findingsService.EPAssignmentScoringRDLC(search, emailInput, ReportType); if (Session["EmailSuccess"] != null) { if (Session["EmailSuccess"].ToString() == "false") { ViewBag.FromEmailSuccess = WebConstants.Email_Failed; } } } catch (Exception ex) { if (ex.Message.ToString() != "Email") { if (ex.Message.ToString() == "No Data") { ModelState.AddModelError("Error", WebConstants.NO_DATA_FOUND_RDLC_VIEW_TSR); } } else { ViewBag.FromEmail = true; ModelState.AddModelError("Error", WebConstants.Email_Failed); } } finally { if (Session["EmailSuccess"] != null) { Session.Remove("EmailSuccess"); } } Session["MyReportViewer"] = reportViewer; return(PartialView("_ReportViewer")); }
public ActionResult _GetEPAssignmentScoringExcelData(SearchEPAssignmentScoringParams search) { JsonResult jr = new JsonResult(); List <EpAssignmentScoringExcel> EpExcelData = new List <EpAssignmentScoringExcel>(); try { if (String.IsNullOrEmpty(search.ScoreValueList)) { search.ScoreValueList = ""; } var findingsService = new EPAssignmentScoring(); EpExcelData = findingsService.GetEpAssignmentScoringExcel(search); jr = Json(EpExcelData, JsonRequestBehavior.AllowGet); jr.MaxJsonLength = Int32.MaxValue; jr.RecursionLimit = 100; return(jr); } catch (Exception ex) { if (ex.Message.ToString() == "No Data") { jr = Json(EpExcelData, JsonRequestBehavior.AllowGet); return(jr); } else { ExceptionLog exceptionLog = new ExceptionLog { ExceptionText = "Reports: " + ex.Message, PageName = "EP Assignment Scoring Report", MethodName = "_GetEPAssignmentScoringExcelData", UserID = Convert.ToInt32(AppSession.UserID), SiteId = Convert.ToInt32(AppSession.SelectedSiteId), TransSQL = "", HttpReferrer = null }; exceptionService.LogException(exceptionLog); return(RedirectToAction("Error", "Transfer")); } } }