public void SetTextHeaderTable(Worksheet sheet) { sheet[0, 0].Value = ""; int mountStart = shedule != null ? shedule.FirstDaySem.Month : 9;//сентябрь по умолчанию SetMonthsHeader(sheet, mountStart, 0, 1, 5); sheet[6, 0].Value = "День"; FontOptionsBase font = (FontOptionsBase)sheet[6, 0].Font; font.Bold = true; AlignmentOptionsBase alOptR = (AlignmentOptionsBase)sheet[6, 0].Alignment; alOptR.Rotate = 90; BorderOptionsBase brOptC = (BorderOptionsBase)sheet[6, 0].Border; brOptC.Color = Color.Black; brOptC.Sides = BorderSides.All; sheet[7, 0].Value = "Часы"; font = (FontOptionsBase)sheet[7, 0].Font; font.Bold = true; alOptR = (AlignmentOptionsBase)sheet[7, 0].Alignment; alOptR.Rotate = 90; brOptC = (BorderOptionsBase)sheet[7, 0].Border; brOptC.Color = Color.Black; brOptC.Sides = BorderSides.All; }
public void FillEntitiesData(Worksheet sheet, string name, int column) { if (shedule == null) { return; } sheet[column, 0].Value = name; FontOptionsBase font = (FontOptionsBase)sheet[column, 0].Font; font.Bold = true; Range range = new Range(sheet[column, 0], sheet[column + 1, 0]); range.Merge(); BorderOptionsBase brOptC = (BorderOptionsBase)range.Border; brOptC.Color = Color.Black; brOptC.Sides = BorderSides.All; int monthStart = shedule.FirstDaySem.Month; List <ScheduleLesson> tmp = shedule.GetLessonsByView(view, name).ToList(); FillLessons(sheet, monthStart, 1, column, tmp, Week.FirstWeek, Week.TreeWeek); FillLessons(sheet, monthStart, 6 * lsnCntMult * lessonHorizontalMult + 1, column, tmp, Week.SecondWeek, Week.FourWeek); }
public void SetMonthsHeader(Worksheet sheet, int monthStart, int rowIndex, int columnIndexStart, int columnIndexEnd) { for (int counterClmn = columnIndexStart, counterMonth = monthStart; counterClmn <= columnIndexEnd; counterClmn++) { sheet[counterClmn, rowIndex].Value = GetMonthName(counterMonth); FontOptionsBase font = (FontOptionsBase)sheet[counterClmn, rowIndex].Font; font.Bold = true; counterMonth = counterMonth == 12 ? 1 : counterMonth + 1; AlignmentOptionsBase alOptR = (AlignmentOptionsBase)sheet[counterClmn, rowIndex].Alignment; alOptR.Rotate = 90; BorderOptionsBase brOptC = (BorderOptionsBase)sheet[counterClmn, rowIndex].Border; brOptC.Color = Color.Black; brOptC.Sides = BorderSides.All; } }
public void SetDaysTable(Worksheet sheet, int dayStart, int columnIndex, int rowIndexStart, int rowIndexEnd) { for (int counterRow = rowIndexStart, counterDay = dayStart; counterRow <= rowIndexEnd * lsnCntMult * lessonHorizontalMult; counterRow += lsnCntMult * lessonHorizontalMult, counterDay++) { sheet[columnIndex, counterRow].Value = GetDayName(counterDay); FontOptionsBase font = (FontOptionsBase)sheet[columnIndex, counterRow].Font; font.Bold = true; AlignmentOptionsBase alOptR = (AlignmentOptionsBase)sheet[columnIndex, counterRow].Alignment; alOptR.Rotate = 90; Range range = new Range(sheet[columnIndex, counterRow], sheet[columnIndex, counterRow + lsnCntMult * lessonHorizontalMult - 1]); range.Merge(); BorderOptionsBase brOptC = (BorderOptionsBase)range.Border; brOptC.Color = Color.Black; brOptC.Sides = BorderSides.All; } }
public void FillHours(Worksheet sheet, int row) { for (int counterDay = 1; counterDay <= 6; counterDay++) { int Hour; for (Hour = 1; Hour <= lsnCntMult; Hour++) { string str = ""; str = ScheduleTime.GetHourDiscription(Hour); sheet[7, row + (Hour - 1) * lessonHorizontalMult].Value = str; FontOptionsBase font = (FontOptionsBase)sheet[7, row + (Hour - 1) * lessonHorizontalMult].Font; font.Bold = true; Range range = new Range(sheet[7, row + (Hour - 1) * lessonHorizontalMult], sheet[7, row + (Hour - 1) * lessonHorizontalMult + lessonHorizontalMult - 1]); range.Merge(); BorderOptionsBase brOptC = (BorderOptionsBase)range.Border; brOptC.Color = Color.Black; brOptC.Sides = BorderSides.All; } row += (Hour - 1) * lessonHorizontalMult; } }
void SetWeeksHeaderTable(Worksheet sheet) { int i = 1; string week1 = "I" + Environment.NewLine + "Н Е Д Е Л Я"; sheet[0, i].Value = week1; FontOptionsBase font = (FontOptionsBase)sheet[0, i].Font; font.Bold = true; AlignmentOptionsBase alOptR = (AlignmentOptionsBase)sheet[0, i].Alignment; alOptR.Rotate = 90; Range range = new Range(sheet[0, i], sheet[0, (i + lsnCntMult - 1) * 6 * lessonHorizontalMult]); range.Merge(); BorderOptionsBase brOptC = (BorderOptionsBase)range.Border; brOptC.Color = Color.Black; brOptC.Sides = BorderSides.All; i += 6 * lsnCntMult * lessonHorizontalMult; string week2 = "II" + Environment.NewLine + "Н Е Д Е Л Я"; sheet[0, i].Value = week2; font = (FontOptionsBase)sheet[0, i].Font; font.Bold = true; alOptR = (AlignmentOptionsBase)sheet[0, i].Alignment; alOptR.Rotate = 90; range = new Range(sheet[0, i], sheet[0, i * 2 - 2]); range.Merge(); brOptC = (BorderOptionsBase)range.Border; brOptC.Color = Color.Black; brOptC.Sides = BorderSides.All; }