public override void SetData() { data = new object[rows, DateWorkHelper.GetMaxDaysInMonths(dates) + 1]; int currentRow = 0; for (int i = 0; i < 12; i++) { if (dates[i] != null) { columns = dates[i].Count + 1; SetMonthData(ref currentRow, i); } } }
public override void SetSheet() { Sheet.Name = SHEET_NAME; if (rows != 0 && columns != 0) { try { Range start = (Range)Sheet.Cells[1, 1]; Range end = (Range)Sheet.Cells[rows, DateWorkHelper.GetMaxDaysInMonths(dates) + 1]; Sheet.Range[start, end].Value2 = GetData(); SetAlignment(rows + 1); Sheet.Columns.AutoFit(); start = (Range)Sheet.Cells[1, 2]; end = (Range)Sheet.Cells[rows, DateWorkHelper.GetMaxDaysInMonths(dates) + 1]; Sheet.Range[start, end].UseStandardWidth = CELL_WIDTH; } catch (Exception) { } } }