diff --git a/backend/src/main/java/ru/micord/ervu_dashboard/service/ExportGridV2Service.java b/backend/src/main/java/ru/micord/ervu_dashboard/service/ExportGridV2Service.java index d9378ef3..5665bdd9 100644 --- a/backend/src/main/java/ru/micord/ervu_dashboard/service/ExportGridV2Service.java +++ b/backend/src/main/java/ru/micord/ervu_dashboard/service/ExportGridV2Service.java @@ -88,7 +88,10 @@ public class ExportGridV2Service extends GridV2ServiceImpl { int minWidth = 20; int padding = 5; - int colIndex = hasAggregationValues ? 1 : 0; + createCell(row, 0, "№", style); + autosizeByHeader(sheet, 0, "№", 5, 3); + + int colIndex = hasAggregationValues ? 2 : 1; for (GridColumn column : orderedColumns) { createCell(row, colIndex, column.displayName, style); autosizeByHeader(sheet, colIndex, column.displayName, minWidth, padding); @@ -134,8 +137,9 @@ public class ExportGridV2Service extends GridV2ServiceImpl { GridColumnAggregationValues aggregationValues = gridRows.getAggregationValues(); for (GridRow gridRow : gridRows.getRows()) { - int columnCount = aggregationValues != null ? 1 : 0; - Row row = sheet.createRow(rowCount++); + Row row = sheet.createRow(rowCount); + createCell(row, 0, rowCount, style); + int columnCount = aggregationValues != null ? 2 : 1; row.setHeight((short) -1); for (GridColumn gridColumn : orderedColumns) { createCell(row, columnCount, @@ -143,6 +147,7 @@ public class ExportGridV2Service extends GridV2ServiceImpl { ); columnCount++; } + rowCount++; } if (aggregationValues != null) { @@ -150,7 +155,7 @@ public class ExportGridV2Service extends GridV2ServiceImpl { CellStyle boldStyle = createBoldStyle(workbook); createCell(aggregationRow, 0, aggregationHeaderForExport, boldStyle); - int columnCount = 1; + int columnCount = 2; for (GridColumn gridColumn : orderedColumns) { createCell(aggregationRow, columnCount, aggregationValues.get(getClientColumnId(gridColumn)), boldStyle