public void SaveReport(string fileName)
 {
     DefaultReportWriter reportWriter = new DefaultReportWriter();
     using (StreamWriter writer = new StreamWriter(fileName))
     {
         reportWriter.WriteReport(reportWrapper.Report, writer);
         reportFileName = fileName;
     }
 }
Beispiel #2
0
        private void mmRunTarget_Click(object sender, EventArgs e)
        {
            if (runTargetForm.ShowDialog() != DialogResult.OK)
                return;

            CloseViews();

            TargetRunner runner = new TargetRunner();
            runner.RunTargetForm = runTargetForm;
            runner.execute(this);

            try
            {
                if (runner.Report.assemblies.Count == 0)
                {
                    ShowInformation("Report is empty. Check settings and run target again.");
                    return;
                }

            }
            catch (Exception ex)
            {
                ShowError("Cannot get report! (" + ex.Message + ")");
                return;
            }

            if (runTargetForm.OutputToFile)
            {
                DefaultReportWriter reportWriter = new DefaultReportWriter();
                StreamWriter writer = new StreamWriter(dlgSave.FileName);
                reportWriter.WriteReport(runner.Report, writer);
                writer.Close();
            }
            else
            {
                ServiceContainer.GetService<ICoverageReportService>().Load(runner.Report);
            }
        }