Ejemplo n.º 1
0
        public void RunCommands()
        {
            if (RunSqlSelectCommand(sqlSelectCommand))
            {
                //itemStringBuilder.Clear();
                if (hasOutput)
                {
                    OutputCommand(table);
                }
                StatisticsHelper statisticsHelper = new StatisticsHelper(table);
                foreach (EStatistics ess in listStatistics)
                {
                    switch (ess)
                    {
                    case EStatistics.DescriptiveStatistics:
                        itemStringBuilder.AppendLine("<p>Descriptive Statistics</p>");
                        OutputCommand(statisticsHelper.OutputDescriptiveStatistics());
                        break;

                    case EStatistics.DescriptiveStatisticsPopulation:
                        itemStringBuilder.AppendLine("<p>Descriptive Statistics for Population</p>");
                        OutputCommand(statisticsHelper.OutputDescriptiveStatisticsPopulation());
                        break;

                    case EStatistics.Correlation:
                        itemStringBuilder.AppendLine("<p>Correlation</p>");
                        OutputCommand(statisticsHelper.OutputCorrelation());
                        break;
                    }
                }
                if (this.graphHelper != null)
                {
                    //graphHelper = new GraphHelper(this, table, 1, 0, System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Pie, 1280, 960);
                    String path = graphHelper.GenerateChart(this, table);
                    itemStringBuilder.AppendLine("<img src='" + path + "' alt='" + this.reportItemName + "'>");
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("There was an error while generating the report for item {0}", this.reportItemName);
            }
        }