public static void WriteList(AbstractList list, string path, IXLSXWriteDataStrategy writeDataStrategy, IXLSXWriteHeaderStrategy headerStrategy, ListType listType) { CellStyleFactory.ResetStyles(); _sheet = SheetFactory.CreateSheet(path); _list = list; headerStrategy.FormatHeader(_list, _sheet, listType); WriteColumnsNames(); if (listType == ListType.BoltsDelivery) { CellRangeAddress blankRegion = new CellRangeAddress(_sheet.LastRowNum, _sheet.LastRowNum, _list.Columns.Count - 1, _list.Columns.Count + 1); IRow columnsRow = _sheet.GetRow(_sheet.LastRowNum); columnsRow.CreateCell(_list.Columns.Count); columnsRow.CreateCell(_list.Columns.Count + 1); columnsRow.GetCell(_list.Columns.Count + 1).CellStyle = CellStyleFactory.CreateCenterAlignmentStyle(_sheet.Workbook); _sheet.AddMergedRegion(blankRegion); } writeDataStrategy.WriteData(list, _sheet); AutosizeAllColumns(); WriteWorkbook(path); OpenWorkbook(path); }