-
Notifications
You must be signed in to change notification settings - Fork 284
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
Autosize of Columns not working with Excel365 #646
Comments
I can replicate that. Is there any workaround? |
We're open for pull requests that correct this issue. |
I have just analyzed my result generated xlsx and it is a mistake in my code. ZDEMO_EXCEL31 only works partly for me. For the last 2-3 rows the columns are to short. The height looks allright. |
Attached you may find the output of program ZDEMO_EXCEL30: |
I was doing some research on this issue and discovered this forum. I am watching this for updates hoping we can get this feature working again. |
I have the same issue with demo 30 and 31 on Excel 2013: the columns are autosized only when double-clicking on the separators in the header. Both with embedded Excel and saved file. Tested with demo 31 on Excel 2013 on Windows and 16.16.27 (201012) on Mac. |
I think ZCL_EXCEL_WRITER_2007->CREATE_XL_SHEET (Row 461) is wrong.
should be changed to:
Same game for ZCL_EXCEL_WRITER_HUGE_FILE (Row 306). |
@dbausch85 why would it be wrong? Granted, I did not debug this particular bit of code but to me it looks like it first attempts to bind an existing iterator and, when it fails, a new one is created. |
Was fixed with #744 |
I have debbuged this case on my side, having the same behaviour. You are totally right. This should be the code change applied in ZCL_EXCEL_WRITER_2007->CREATE_XL_SHEET " Calculate col Same for ZCL_EXCEL_WRITER_HUGE_FILE. |
Just a few facts to assert this issue is not an issue:
The logic of I think it's the best we can do, as far as I know. If anyone can find evidence of a feature in Excel to auto-size the columns, please let us know. Also, please open a new ticket only if you have additional arguments. |
I did it this way for auto sizing all columns from fieldcatalog:
|
get_column_dimension is out of date. |
@AiolosYang See my answer above (June 22nd, 2022). |
Hi,
recently i have updated the source codes. Since then method get_row_dimension() of class zcl_excel_worksheet has been deprecated.
I used this method to set auto size for certain columns.
Now i have to use the auto_size method of class zcl_excel_column. Unfortunately the columns are not sized in Excel 365 anymore.
Also the columns in files generated with demo reports ZDEMO_EXCEL30 and ZDEMO_EXCEL31 are not autosized (Autofit in Excel) any more. Is is any solution or workaround available?
31_AutosizeWithDifferentFontSizes.xlsx
BR
The text was updated successfully, but these errors were encountered: