예제 #1
0
        private static void BuildSumPerDayRow(IExcelBuilder excelBuilder, Guid sheetId, ReportDataBuilder reportDataBuilder)
        {
            int rowWithSum  = reportDataBuilder.People.Count() + PEOPLE_ROW_START;
            int columnStart = DAYS_COLUMN_START;

            foreach (var day in reportDataBuilder.Days)
            {
                excelBuilder.SumCells(sheetId, new ExcelCell(rowWithSum, columnStart), new ExcelCell(PEOPLE_ROW_START, columnStart), new ExcelCell(rowWithSum - 1, columnStart));
                excelBuilder.SetCellBackground(sheetId, new ExcelCell(rowWithSum, columnStart), Color.Gold);
                columnStart++;
            }
        }
예제 #2
0
        private static void BuildSumPerPerson(IExcelBuilder excelBuilder, Guid sheetId,
                                              ReportDataBuilder reportDataBuilder)
        {
            excelBuilder.AddValueToCell(sheetId, new ExcelCell(DAYS_ROW + 1, SUM_PER_PERSON_COLUMN), "SUMA", Color.LawnGreen);
            int rowStart = PEOPLE_ROW_START;

            foreach (var person in reportDataBuilder.People)
            {
                excelBuilder.SumCells(sheetId, new ExcelCell(rowStart, SUM_PER_PERSON_COLUMN), new ExcelCell(rowStart, DAYS_COLUMN_START), new ExcelCell(rowStart, SUM_PER_PERSON_COLUMN - 1));
                excelBuilder.SetCellBackground(sheetId, new ExcelCell(rowStart, SUM_PER_PERSON_COLUMN), Color.LawnGreen);
                rowStart++;
            }
        }