export add number column

This commit is contained in:
Александр Савельев 2025-11-24 10:05:37 +03:00
parent ddad4dc73b
commit 6596561e6c

View file

@ -88,7 +88,10 @@ public class ExportGridV2Service extends GridV2ServiceImpl {
int minWidth = 20; int minWidth = 20;
int padding = 5; 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) { for (GridColumn column : orderedColumns) {
createCell(row, colIndex, column.displayName, style); createCell(row, colIndex, column.displayName, style);
autosizeByHeader(sheet, colIndex, column.displayName, minWidth, padding); autosizeByHeader(sheet, colIndex, column.displayName, minWidth, padding);
@ -134,8 +137,9 @@ public class ExportGridV2Service extends GridV2ServiceImpl {
GridColumnAggregationValues aggregationValues = gridRows.getAggregationValues(); GridColumnAggregationValues aggregationValues = gridRows.getAggregationValues();
for (GridRow gridRow : gridRows.getRows()) { 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); row.setHeight((short) -1);
for (GridColumn gridColumn : orderedColumns) { for (GridColumn gridColumn : orderedColumns) {
createCell(row, columnCount, createCell(row, columnCount,
@ -143,6 +147,7 @@ public class ExportGridV2Service extends GridV2ServiceImpl {
); );
columnCount++; columnCount++;
} }
rowCount++;
} }
if (aggregationValues != null) { if (aggregationValues != null) {
@ -150,7 +155,7 @@ public class ExportGridV2Service extends GridV2ServiceImpl {
CellStyle boldStyle = createBoldStyle(workbook); CellStyle boldStyle = createBoldStyle(workbook);
createCell(aggregationRow, 0, aggregationHeaderForExport, boldStyle); createCell(aggregationRow, 0, aggregationHeaderForExport, boldStyle);
int columnCount = 1; int columnCount = 2;
for (GridColumn gridColumn : orderedColumns) { for (GridColumn gridColumn : orderedColumns) {
createCell(aggregationRow, columnCount, createCell(aggregationRow, columnCount,
aggregationValues.get(getClientColumnId(gridColumn)), boldStyle aggregationValues.get(getClientColumnId(gridColumn)), boldStyle