You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2023/11/07 09:13:57 UTC
[Bug 68094] New: In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
Bug ID: 68094
Summary: In 5.2.4 After called autoSizeColumn function, the
returned column width is smaller than in 5.2.3, which
makes the columns to be cut off
Product: POI
Version: unspecified
Hardware: PC
OS: other
Status: NEW
Severity: regression
Priority: P2
Component: SS Common
Assignee: dev@poi.apache.org
Reporter: coco.dai@sap.com
Target Milestone: ---
Created attachment 39351
--> https://bz.apache.org/bugzilla/attachment.cgi?id=39351&action=edit
Tab generaged by 5.2.3 (expected) and tab generated by 5.2.4
My OS is Win11
org.apache.poi.ss.usermodel.Sheet.autoSizeColumn
5.2.3
------------Before resize column 0, the column width is 2048
------------After resize column 0, the column width is 4462
5.2.4
------------Before resize column 0, the column width is 2048
------------After resize column 0, the column width is 3718
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #21 from PJ Fanning <fa...@yahoo.com> ---
There are still some unreleased changes so the most practical solution for
people who think autoSizeColumn is making the columns too narrow or too wide is
to make the autosize calls and then to loop over the columns again.
You can call getColumnWidth for each column and adjust the value by for
instance, adding an arbitrary amount by calling setColumnWidth.
https://javadoc.io/static/org.apache.poi/poi-ooxml/5.4.1/org/apache/poi/xssf/usermodel/XSSFSheet.html#getColumnWidth-int-
https://javadoc.io/static/org.apache.poi/poi-ooxml/5.4.1/org/apache/poi/xssf/usermodel/XSSFSheet.html#setColumnWidth-int-int-
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #5 from Coco Dai <co...@sap.com> ---
The file generated with 5.2.5 still have column content be cut off a little
bit.see attachment
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
Coco Dai <co...@sap.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #39351|0 |1
is obsolete| |
Attachment #39388|0 |1
is obsolete| |
--- Comment #6 from Coco Dai <co...@sap.com> ---
Created attachment 39389
--> https://bz.apache.org/bugzilla/attachment.cgi?id=39389&action=edit
result of 5.2.3, 5.2.4, 5.2.5
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #11 from Dominik Stadler <do...@gmx.at> ---
See https://bz.apache.org/bugzilla/attachment.cgi?id=39602 in bug #68245 for a
standalone project to compare results of the two versions.
Things to note from this test-case:
* LibreOffice shows the columns properly, only Excel shows columns as "too
small", so not even the UIs agree on how to handle this :(
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
PJ Fanning <fa...@yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Blocks| |68245
Referenced Bugs:
https://bz.apache.org/bugzilla/show_bug.cgi?id=68245
[Bug 68245] Unable to autosize columns since 5.2.4
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
Coco Dai <co...@sap.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|FIXED |---
Status|RESOLVED |REOPENED
--- Comment #7 from Coco Dai <co...@sap.com> ---
The content would still be cut off 1 char at J50, this looks not totally fixed
for me.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
Dominik Stadler <do...@gmx.at> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |NEEDINFO
--- Comment #18 from Dominik Stadler <do...@gmx.at> ---
You seem to have been lucky in the past :)
It seems that a fix for one given set of OS+Version+Spreadsheet-App+Fonts
breaks it for some others.
And even Windows has differences with local Excel and the 360-Online-version
and different versions of the application.
So unfortunately Apache POI developers have mostly given up on spending more
time on this topic as it proves to be never-ending.
If you think it "cannot be that hard", then please help, patches welcome if you
think you can improve it, but please make sure to test it on more than one
single machine.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
I think this is related to https://github.com/apache/poi/pull/541.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
Daniel <da...@icloud.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel77lundin@icloud.com
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #2 from Coco Dai <co...@sap.com> ---
Thanks for your quick response! I'm wondering in which release would the fix be
available?
We upgraded the library due to security policy, and now the function is broken.
Thanks,
Coco Dai
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
PJ Fanning <fa...@yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
Dominik Stadler <do...@gmx.at> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|NEW |RESOLVED
--- Comment #16 from Dominik Stadler <do...@gmx.at> ---
Revision r1923071 which will be included in 5.4.1 or newer provides fixes to
the "arbitraryExtraWidth" which now should allow to adjust Apache POI to the
local environment.
You can use SXSSFSheet.setArbitraryExtraWidth() to define an adjustment value.
As discussed above, there is unfortunately no way to fully "fix" this as OS,
application, installed fonts and other factors influence width-handling and so
do not allow a general solution which works for everyone.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #3 from PJ Fanning <fa...@yahoo.com> ---
v5.2.5 should be released in a few weeks. It would be helpful if you tried
testing using a snapshot version of POI. They can be found here -
https://ci-builds.apache.org/job/POI/job/POI-DSL-1.8/lastSuccessfulBuild/artifact/build/dist/maven/
The change related to https://github.com/apache/poi/pull/541 does not revert to
the v5.2.3 behaviour. It tries to improve the width calculations by not
rounding one of the intermediate values.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
Dominik Stadler <do...@gmx.at> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |NEW
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
Dominik Stadler <do...@gmx.at> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INFORMATIONPROVIDED
Status|NEEDINFO |RESOLVED
--- Comment #22 from Dominik Stadler <do...@gmx.at> ---
We likely cannot fully fix autosizing of columns for everyone.
Since version 5.4.1, POI provides XSSFSheet#setArbitraryExtraWidth() which
allows users to adjust computation of width.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #9 from Dominik Stadler <do...@gmx.at> ---
Unfortunately autosizing often cannot be 100% accurate because of different
font-installations, special characters, operating-systems, Excel vs.
LibreOffice and other factors, so we likely cannot make it work always
perfectly!
Even when opening the same Excel file in Excel and LibreOffice, there is very
often a difference in how wide columns are.
We might consider a customizable "adjustment factor" which would allow users to
adjust it to their given environment.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
Dominik Stadler <do...@gmx.at> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |keilhofer@gmail.com
--- Comment #10 from Dominik Stadler <do...@gmx.at> ---
*** Bug 68245 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #19 from PJ Fanning <fa...@yahoo.com> ---
Most outside contributors are typically only providing solutions for this that
works for them and not worrying about the impact on other users.
I would prefer not to take any changes that tweak the calculations.
I like the idea of supporting changes like the one to add arbitrary extra width
to the calculated column widths.
I would also like to see a change that makes the auto calculation entirely
pluggable so that users can choose to plug out the built-in calculations and
implement a class themselves that suits their needs.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #15 from PJ Fanning <fa...@yahoo.com> ---
https://github.com/apache/poi/pull/657 will appear in v5.3.1
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #8 from whaid@hotmail.com ---
(In reply to Coco Dai from comment #7)
> The content would still be cut off 1 char at J50, this looks not totally
> fixed for me.
Yes, same for me, it's not totally fixed. Content is still cut off!
Worked good in version 5.2.3.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #20 from PJ Fanning <fa...@yahoo.com> ---
I added the SXSSFSheet arbitrary extra width support to XSSFSheet too.
r1924335
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #4 from Coco Dai <co...@sap.com> ---
Created attachment 39388
--> https://bz.apache.org/bugzilla/attachment.cgi?id=39388&action=edit
File auto changed the column size with 5.2.5
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
PJ Fanning <fa...@yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |elena.alexandrova@betanxt.c
| |om
--- Comment #14 from PJ Fanning <fa...@yahoo.com> ---
*** Bug 69321 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #13 from whaid@hotmail.com ---
Tried POI version 5.3.0.
Using MS Excel, content is still cut off.
Worked good in version 5.2.3.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
--- Comment #12 from Dominik Stadler <do...@gmx.at> ---
Some changes were applied as part of Apache POI 5.3.0, see r1913676, however
some manual tests showed that the actual result is dependent on the application
used to display the workbook, so columns may still be either too small or too
big.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
[Bug 68094] In 5.2.4 After called autoSizeColumn function, the returned column width is smaller than in 5.2.3, which makes the columns to be cut off
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=68094
whaid@hotmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|FIXED |---
--- Comment #17 from whaid@hotmail.com ---
I really do not understand why it should not be possible to calculate the
correct width for the columns. I'm not talking about SXSSF columns, I'm talking
about XSSF columns.
It worked perfectly for years up to version 5.2.3 and then broke.
It should at least work with a standard OS (Windows), standard fonts and a
standard application (MS Excel). Other libraries are able to calculate the
correct size of fonts etc. without any problems.
It seems that since version 5.2.4 there is a calculation error of exactly 1
character.
Adding an extra 256, which is the value used inside XSSFSheet in the
autoSizeColumn function to multiply by the width, everything works fine.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org