Esempio n. 1
0
        private void ButtonGenerateHtmlFile_Click(object sender, EventArgs e)
        {
            if (AvailableSummary)
            {
                // Modify HTML template
                CreateReportHTML();

                // Modify Dataset in chart-bar.js
                EditBarChartDatasets();

                // Modify Dataset in chart-pie.js
                EditPieChartDatasets();

                if (CurrentPanel != null)
                {
                    CurrentPanel.Hide();
                }

                ButtonPanelHTMLOpenInBrowser.Visible = true;
                ButtonPanelHTMLOpenInBrowser.BringToFront();
                PanelReportCreated.Show();
                CurrentPanel = PanelReportCreated;
                CurrentPanel.Refresh();

                PictureBoxPanelHTML.Image = Image.FromFile("..\\..\\..\\static\\report-created.png");
                PictureBoxPanelHTML.Refresh();
                CurrentPanel.Refresh();

                string path = Path.GetFullPath(Directory.GetCurrentDirectory() + "\\..\\..\\..\\template\\report.html");
                NotifyLoadFile.ShowBalloonTip(100, "HTML Report Available", "Path: " + path, ToolTipIcon.Info);
                TestPlan.ClearResults();
            }
        }
Esempio n. 2
0
        private void ButtonDownloadXLS_Click(object sender, EventArgs e)
        {
            if (AvailableSummary)
            {
                if (CurrentPanel != null)
                {
                    CurrentPanel.Hide();
                }

                OpenXlsxReport.Visible = true;
                OpenXlsxReport.BringToFront();
                PanelReportCreated.Show();
                CurrentPanel = PanelReportCreated;
                CurrentPanel.Refresh();

                PictureBoxPanelHTML.Image = Image.FromFile("..\\..\\..\\static\\report-created.png");
                PictureBoxPanelHTML.Refresh();
                CurrentPanel.Refresh();

                Excel workbook = new Excel("report.xlsx", this.NotifyLoadFile);
                workbook.PerformChanges(this.TestPlan);
                NotifyLoadFile.ShowBalloonTip(100, "XLSX Report Available", "Path: " + workbook.GetFilePath(), ToolTipIcon.Info);
            }
        }