From ed6f78e4a62f8ba816ebe761ab4acbf5e184da1a Mon Sep 17 00:00:00 2001 From: serge-rider Date: Sun, 3 Jun 2018 23:13:13 +0300 Subject: [PATCH] #3556 XLS export: fix empty resultset export --- .../dbeaver/data/office/export/DataExporterXLSX.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/org.jkiss.dbeaver.data.office/src/org/jkiss/dbeaver/data/office/export/DataExporterXLSX.java b/plugins/org.jkiss.dbeaver.data.office/src/org/jkiss/dbeaver/data/office/export/DataExporterXLSX.java index f35ec62aae..2c6362d42f 100644 --- a/plugins/org.jkiss.dbeaver.data.office/src/org/jkiss/dbeaver/data/office/export/DataExporterXLSX.java +++ b/plugins/org.jkiss.dbeaver.data.office/src/org/jkiss/dbeaver/data/office/export/DataExporterXLSX.java @@ -94,6 +94,7 @@ public class DataExporterXLSX extends StreamExporterAbstract { private int splitByRowCount = EXCEL2007MAXROWS; private int splitByCol = 0; + private int rowCount = 0; private XSSFCellStyle style; private XSSFCellStyle styleHeader; @@ -240,7 +241,7 @@ public class DataExporterXLSX extends StreamExporterAbstract { style.setBorderBottom(border); style.setBorderLeft(border); style.setBorderRight(border); - + this.rowCount = 0; super.init(site); } @@ -477,7 +478,7 @@ public class DataExporterXLSX extends StreamExporterAbstract { } wsh.incRow(); - + rowCount++; } private CellType getCellType(DBDAttributeBinding column) { @@ -495,8 +496,11 @@ public class DataExporterXLSX extends StreamExporterAbstract { @Override public void exportFooter(DBRProgressMonitor monitor) - throws DBException, IOException { - + throws DBException, IOException + { + if (rowCount == 0) { + exportRow(null, new Object[columns.size()]); + } } -- GitLab