Example #1
0
        private static void AddDataAnalyzeSheet(Worksheet sheetDataAnalyze, Worksheet sheetResult)
        {
            //Insert Title
            sheetDataAnalyze.Name = "04_DataAnalyze";

            //Add

            var lastRow = sheetDataAnalyze.Cells.SpecialCells(XlCellType.xlCellTypeLastCell).Row;

            sheetDataAnalyze.Cells[lastRow, 1] = "Mark";
            sheetDataAnalyze.Cells[lastRow, 2] = "Amount";
            //Counting
            var scoreRange = sheetResult.Range["G:G"];

            for (var i = 0; i < 11; i++)
            {
                lastRow++;
                sheetDataAnalyze.Cells[lastRow, 1] = string.Concat("'>=", i);
                sheetDataAnalyze.Cells[lastRow, 2] = _wsf.CountIfs(scoreRange, string.Concat(">=", i), scoreRange,
                                                                   string.Concat("<", i + 1));
            }
            //Add Score Line Chart
            AddChart(sheetDataAnalyze, sheetDataAnalyze.Range["A1", "B12"], 200, 15, "Score Line", "Amount", "Score");
            //Add Paper Score
        }