public ActionResult Get(ReportOptions form) { if (form.ProjectIds.Contains(Constants.AllProjectsId)) { var viewableProjects = ProjectManager.GetAppViewableProjects(this); form.ProjectIds = viewableProjects.Count > 0 ? viewableProjects.Select(p => p.Entity.Id).ToList() : new List <int>(); form.AllProjectsSelected = true; } form.SummaryChart = form.SummaryChart.GetValueOrDefault(); return(GetSummaryReport(form)); }
private JsonResponse JsonResponse(ReportOptions options, string html) { CurrentCard.Options[AppGuid] = options.ToJson(); if (!CurrentCard.Url.HasValue()) { CurrentCard.Url = NavigationHelper.GetReportsPageUrl(CurrentProject); } var r = new JsonResponse() { Success = true, Result = new { Html = html, SavedCard = CurrentCard } }; return(r); }
private ActionResult GetSummaryReportMaster(ReportOptions options) { string projectNames = string.Empty; if (options.AllProjectsSelected) { projectNames = "All Projects"; } else { var list = new List <ProjectDto>(options.ProjectIds.Count()); list.AddRange(options.ProjectIds.Select(id => ProjectManager.Get(id))); projectNames = string.Join(", ", list.Select(s => s.Entity.Name).ToList()); } return(Json(JsonResponse(options, RenderPartialViewToString(this, AppManager.Instance.GetAppUrl(AppGuid, "views/_Summary.cshtml"), projectNames)))); }
private ActionResult GetSummaryByVersion(ReportOptions options) { var reportManager = new ReportManager(GeminiApp.Cache(), UserContext, GeminiContext); var list = new List <ProjectDto>(options.ProjectIds.Count()); list.AddRange(options.ProjectIds.Select(id => ProjectManager.Get(id))); var SummaryByVersion = reportManager.GetSummaryByVersion(list); foreach (var Summary in SummaryByVersion) { Summary.FilterName = "versions"; } var resultModel = new ReportResultModel { UserContext = UserContext, Results = SummaryByVersion, Title = GetResource(ResourceKeys.Versions), Flag = options.SummaryChart.GetValueOrDefault(), ProjectIds = options.ProjectIds }; //TODO add new key for this return(Json(JsonResponse(options, RenderPartialViewToString(this, AppManager.Instance.GetAppUrl(AppGuid, "views/_SummaryItem.cshtml"), resultModel)))); }