-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect Column Width returned By GetColWidth #261
Labels
confirmed
This issue can be reproduced
Comments
@teschste I met this issue and borrown a solution from sheetjs :) I called px2width before setting col width
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
I have found that if you open a workbook that was previously saved with excelize but has not yet been opened and re-saved with Excel, and then call GetColWidth on any column, it will report the column width as 64, no matter what the actual column width is.
Steps to reproduce the issue:
Describe the results you received:
After comparing the unzipped version of a sheet created by excelize, both before and after re-saving the same workbook with Excel, I have found two problems:
For a column that had no been specifically adressed during the file creating process, there is no col property to read, so some process is defaulting the width to 64, which is not the default column width in Excel.
When excelize saves the column properties (say after calling SetColwidth), it sets the customWidth property to "true" but when Excel saves the same value, it sets it to "1".
For the second problem above, I have found that if I take a workbook that was created by excelize, unzip it, edit the column's customWidth property so it is set to "1" instead of "true", then zip the workbook up again, the problem is resolved andGetColWidth now reports the correct column width.
Describe the results you expected:
I expected the correct default value returned by GetColWidth for undefined columns.
I expected excelize to store properties in the same way that Excel does (i.e. customWidth property on defined columns set to "1" instead of "true).
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):
Windows 7 Professional SP1 64-bit, Core i5-2400 @ 3.10GHz, with 8GB RAM
Excel 2007 12.0.6787.5000 SP3 MSO
The text was updated successfully, but these errors were encountered: