From 254dcb3955a42121a23b847c607509f2fc60b3e0 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud <58596990+nmicoud@users.noreply.github.com> Date: Thu, 27 Apr 2023 07:34:11 +0200 Subject: [PATCH] =?UTF-8?q?IDEMPIERE-5696:=20Width=20of=20last=20column=20?= =?UTF-8?q?of=20reports=20exported=20as=20Xlsx=20is=20n=E2=80=A6=20(#1806)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * IDEMPIERE-5696: Width of last column of reports exported as Xlsx is not correct https://idempiere.atlassian.net/browse/IDEMPIERE-5696 * IDEMPIERE-5696: Width of last column of reports exported as Xlsx is not correct - patch from hengsin Co-Authored-By: hengsin <152246+hengsin@users.noreply.github.com> --------- Co-authored-by: hengsin <152246+hengsin@users.noreply.github.com> --- .../src/org/adempiere/impexp/AbstractXLSXExporter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java b/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java index 9f586fe839..b1fbece037 100644 --- a/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java +++ b/org.adempiere.base/src/org/adempiere/impexp/AbstractXLSXExporter.java @@ -321,9 +321,9 @@ public abstract class AbstractXLSXExporter return cs_header; } - private void fixColumnWidth(XSSFSheet sheet, int lastColumnIndex) + private void fixColumnWidth(XSSFSheet sheet, int colCount) { - for (short colnum = 0; colnum < lastColumnIndex; colnum++) + for (short colnum = 0; colnum < colCount; colnum++) { sheet.autoSizeColumn(colnum); } @@ -488,9 +488,7 @@ public abstract class AbstractXLSXExporter // for all columns int colnum = 0; for (int col = 0; col < getColumnCount(); col++) - { - if (colnum > colnumMax) - colnumMax = colnum; + { // if (isColumnPrinted(col)) { @@ -589,6 +587,8 @@ public abstract class AbstractXLSXExporter } // colnum++; + if (colnum > colnumMax) + colnumMax = colnum; if (colSuppressRepeats != null) preValues[printColIndex] = obj; } // printed