public ActionResult _GetCMSComplianceExcelData(SearchCMSCompliance search) { try { ValidateSearchCriteria(search); var cmsComplianceService = new CMSCompliance(); JsonResult jr = new JsonResult(); var excelData = cmsComplianceService.GetCMSComplianceExcel(search); jr = Json(excelData, JsonRequestBehavior.AllowGet); jr.MaxJsonLength = Int32.MaxValue; jr.RecursionLimit = 100; return(jr); } catch (Exception ex) { ExceptionLog exceptionLog = new ExceptionLog { ExceptionText = "Reports: " + ex.Message, PageName = "CMS Compliance Report", MethodName = "_GetCMSComplianceExcelData", UserID = Convert.ToInt32(AppSession.UserID), SiteId = Convert.ToInt32(AppSession.SelectedSiteId), TransSQL = "", HttpReferrer = null }; exceptionService.LogException(exceptionLog); return(RedirectToAction("Error", "Transfer")); } }
public PartialViewResult _GetCMSComplianceRDLCData(SearchCMSCompliance search, Email emailInput, string ReportType = "Summary") { ReportViewer reportViewer = new ReportViewer(); try { ValidateSearchCriteria(search); var cmsComplianceService = new CMSCompliance(); if (emailInput.To != null) { ViewBag.FromEmail = true; ViewBag.FromEmailSuccess = WebConstants.Email_Success; } reportViewer = cmsComplianceService.CMSComplianceRDLC(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")); }