IDEMPIERE-5696: Width of last column of reports exported as Xlsx is n… (#1806)

* 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>
This commit is contained in:
Nicolas Micoud 2023-04-27 07:34:11 +02:00 committed by GitHub
parent 796ab2d95f
commit 254dcb3955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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