public int RowSpan(ExcelHeader header) { int rows = 1; if (header.SubExcelHeaders.Count() > 0) { rows += 1; foreach (var sub in header.SubExcelHeaders) { rows += RowSpan(sub); sub.Level = header.Level + 1; } } return(rows); }
public int ColSpan(ExcelHeader header) { int cells = 1; if (header.SubExcelHeaders.Count() > 0) { foreach (var sub in header.SubExcelHeaders) { cells += header.SubExcelHeaders.IndexOf(sub) == 0 ? 0 : ColSpan(sub); } } return(cells); //return SubExcelHeaders.Count(); }