public ActionResult ReportHoy(DesdeHasta desdehasta) { #region null? if (desdehasta.Hasta == null) { desdehasta.Hasta = DateTime.Now.ToString("MM/dd/yyyy"); } if (desdehasta.Desde == null) { desdehasta.Desde = DateTime.Now.ToString("MM/dd/yyyy"); } #endregion #region normalizar string resultadoDesde = desdehasta.Desde.Substring(0, 10); resultadoDesde = resultadoDesde + " 00:01:00"; string resultadoHasta = desdehasta.Hasta.Substring(0, 10); resultadoHasta = resultadoHasta + " 23:59:59"; #endregion IssuesReport issueReport = new IssuesReport(); byte[] abytes = issueReport.PrepareReport(resultadoDesde, resultadoHasta, GetIssuesHoy(resultadoDesde, resultadoHasta)); return(File(abytes, "application/pdf")); }
public async Task <IssuesReport> GetIssuesReportAsync(string query) { IssuesReport report = null; HttpResponseMessage response = await client.GetAsync("issues/search" + query + "&ps=500&facets=severities%2Ctypes&additionalFields=_all"); if (response.IsSuccessStatusCode) { report = await response.Content.ReadAsAsync <IssuesReport>(); } return(report); }
private async void SetSubDataSource(object sender, SubreportProcessingEventArgs e) { string ruleKey = e.Parameters["ruleKey"].Values[0]; string dataSourceName = e.DataSourceNames[0]; IssuesReport issuesReport = await sonarReportProcessor.SonarAPI.GetIssuesReportAsync(sonarReportProcessor.ParamsBuilder.QueryString).ConfigureAwait(true); ReportDataSource DataSet1 = new ReportDataSource { Name = "Issues", Value = issuesReport.Issues }; e.DataSources.Add(DataSet1); }
public async Task <List <Rule> > GetRulesDescAsync(IssuesReport issuesReport) { var selectedRules = issuesReport.Rules; List <Rule> result = new List <Rule>(); foreach (var rule in selectedRules) { var report = await GetRuleDescAsync(rule.Key); result.Add(report.Rule); } return(result); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Title = H1.InnerText = "Issues Report"; var issueLevel = GetQueryString("IssueLevel"); var group = GetQueryString("Group"); if (IsNullOrWhiteSpace(issueLevel) || IsNullOrWhiteSpace(group)) { HandleFatalError("IssueLevel and/or Group is missing"); } IssuesReport.GetReport(issueLevel, group) .AddTo(ReportPlaceHolder); } }
private async void SonarReportTypeMenuItem_Click(object sender, EventArgs e) { sonarReportProcessor.ParamsBuilder.ShowDialog(); if (sonarReportProcessor.ParamsBuilder.DialogResult == DialogResult.OK) { reportViewer1.Reset(); IssuesReport issuesReport = await sonarReportProcessor.SonarAPI.GetIssuesReportAsync(sonarReportProcessor.ParamsBuilder.QueryString).ConfigureAwait(true); reportViewer1.LocalReport.ReportPath = string.Format(CultureInfo.InvariantCulture, "Reports/{0}.rdlc", ((ToolStripMenuItem)sender).Tag.ToString()); if (issuesReport != null) { reportViewer1.LocalReport.SubreportProcessing += new SubreportProcessingEventHandler(SetSubDataSource); //ReportDataSource DataSet1 = new ReportDataSource { Name = "Issues", Value = issuesReport.Issues }; //reportViewer1.LocalReport.DataSources.Add(DataSet1); List <Rule> rules = await sonarReportProcessor.SonarAPI.GetRulesDescAsync(issuesReport).ConfigureAwait(true); ReportDataSource DataSet2 = new ReportDataSource { Name = "Rules", Value = rules }; reportViewer1.LocalReport.DataSources.Add(DataSet2); ReportDataSource DataSet3 = new ReportDataSource { Name = "Params", Value = sonarReportProcessor.ParamsBuilder.QueryParams }; reportViewer1.LocalReport.DataSources.Add(DataSet3); reportViewer1.RefreshReport(); } } }