When opening the result file and switching to the “Page Layout” view, the last col does not fit the page and overlaps to the next page (upper half of attached screenshot). pagesetup_view.png (52.3 KB)
Now click the “print” button => the preview shows that now the columns fit on one page.
After returning to the “Page Layout” view, all columns fit on one page. See screenshot, lower part.
Is this an excel issue or can there anything be improved?
Yes, I tested and found the same behavior. It looks like this is something to do with “Paget Layout” and MS Excel’s behavior itself. Anyways, we will further evaluate and get back to you with more details on it.
this sounds very promising and works fine for the original sample. But when the workbook has a default font other than “Calibri”, the “Page Layout” view is wrong the first time: the ruler goes to 29 and an empty column (from the next page) is displayed at the end of the page.
It works if you switch to another view and back. But unfortunately, our real world template has the default view “Page Layout”, thus the issue is noticed.
Attached a reworked sample: it loads a template with default font “Calibri” (this works) and another with default font “Times New Roman” (this is broken) and creates result files. ColWidth_2021-03-11.zip (41.1 KB)
For compiling the sample, you probably have to call “Restore Nuget packages”.
The screenshot shows the difference: results.png (45.7 KB)
I can see the issue in your generated file “result_TimesNewRoman.xlsx”. However, the template file “template_TimesNewRoman.xlsx” is missed in your shared project. Please share it to us, we will create a ticket for it.
@wknauf,
Thank you for the template file. We have analyzed the issue and logged a ticket for further investigation. You will be notified here once any update is ready for sharing.
This issue is logged as: CELLSNET-47923 - Improper page layout view for workbook having default font other than Calibri
The issues you have found earlier (filed as CELLSNET-47923) have been fixed in this update. This message was posted using Bugs notification tool by simon.zhao