Skip to content

Commit 4530521

Browse files
author
GWA
committed
Bug fix: #46
Excel export: The "Auto filter" option activated the auto filter for one extra (empty) column at the end of the Excel sheet.
1 parent 17f16bd commit 4530521

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

sql12/core/doc/changes.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ Table cell data popup now offers find, Xml/Json-reformatting and export function
7676

7777
Bug fixes:
7878

79+
https://github.com/squirrel-sql-client/squirrel-sql-code/issues/46
80+
Excel export: The "Auto filter" option activated the auto filter for
81+
one extra (empty) column at the end of the Excel sheet.
82+
7983
Follow up to #1530: The number of a Session's finalized result tabs do not appear in SQuirreL's logs anymore
8084
but in the "Session garbage collection status", see button on the left of the garbage collection button.
8185

sql12/core/src/net/sourceforge/squirrel_sql/fw/gui/action/fileexport/DataExportExcelWriter.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818
*/
1919
package net.sourceforge.squirrel_sql.fw.gui.action.fileexport;
2020

21+
import java.io.File;
22+
import java.io.FileOutputStream;
23+
import java.sql.Types;
24+
import java.text.NumberFormat;
25+
import java.util.Calendar;
26+
import java.util.Date;
27+
import java.util.HashMap;
28+
import java.util.Iterator;
29+
2130
import net.sourceforge.squirrel_sql.fw.datasetviewer.ColumnDisplayDefinition;
2231
import net.sourceforge.squirrel_sql.fw.datasetviewer.cellcomponent.CellComponentFactory;
2332
import net.sourceforge.squirrel_sql.fw.sql.ProgressAbortCallback;
@@ -34,15 +43,6 @@
3443
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
3544
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
3645

37-
import java.io.File;
38-
import java.io.FileOutputStream;
39-
import java.sql.Types;
40-
import java.text.NumberFormat;
41-
import java.util.Calendar;
42-
import java.util.Date;
43-
import java.util.HashMap;
44-
import java.util.Iterator;
45-
4646
/**
4747
* Exports {@link IExportData} to a Excel file.
4848
* <b>Note:</b> This class is the result of a refactoring task. The code was
@@ -88,7 +88,7 @@ public long write(ExportDataInfoList exportDataInfoList, TableExportPreferences
8888

8989
if(prefs.isExcelAutoFilter())
9090
{
91-
_sheet.setAutoFilter(new CellRangeAddress(0, 0, 0, exportDataInfo.getExportData().getColumnCount()));
91+
_sheet.setAutoFilter(new CellRangeAddress(0, 0, 0, exportDataInfo.getExportData().getColumnCount() - 1));
9292
}
9393
}
9494
_fileExportService.progress(s_stringMgr.getString("DataExportExcelWriter.finishedLoading", NumberFormat.getInstance().format(rowsCount)));

0 commit comments

Comments
 (0)