-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Export column width sets on wrong column, when export to excel #511
Comments
Yes widths are defined per column. Also your 50px get converted to Excels pts with regards to default font. See https://docs.microsoft.com/en-us/office/troubleshoot/excel/determine-column-widths#:~:text=In%20a%20new%20Excel%20workbook,correctly%20set%20to%20Arial%2010. |
Did you really read the issue? I don't ask how export column width or excel width point works, I understand that. The issue is that export columns width is set on wrong column on export to excel. |
Well your example set 50px to title. And your Excel Screenshot shows 8.43, which is the converted value. If you meant something different please elaborate |
Export column width are not in pixels: Here are the rest of the result: One example where I remove export column width on title: I been work with this issues for two work days, so I have try things like this already. |
@Chibi86 are you referring to this Excel Custom Column Width - Wiki? The default is 10, you can see it on this line and I don't know if it really uses Note |
Yes, I referring to "Excel Custom Column Width - Wiki". I can confirm it takes pt, if I move column width in excel file to right column were I have calculate text width in pt it fits perfectly. What I can see in excelExport.service.js: |
I'm not exactly sure what you mean by grouping, but PR (Pull Request) are welcome, so if know how to fix then please submit a PR in Slickgrid-Universal, thanks. |
What I mean is the variable grouping which is declared on row 288 which is based on dataView.getGrouping(). |
The thing is that you now talk about grouping but that is not anywhere in your very short code sample & print screen in your original question. So again I'm not sure why you talk about grouping now? If you don't want to create a PR, you will have to at least provide a full code sample (on dumber or any other sandbox), I created that Excel Export Service 2 years ago, I don't fully recall on everything I wrote in that service. So please provide more steps and more code... or even better a PR to fix the issue. |
@Chibi86 ok I see the problem after testing that in any of the grid, what you were trying to say (I think) is that I'll push a fix soon, I was about to push a new version this week anyway. |
- the custom width was not applied to the correct column, when user had a custom width on column 1 it was applied to column 2. The bug was that getGrouping() always return an array and we should check for its length instead (not just if it exist) - fixes issue report in Aurelia-Slickgrid ghiscoding/aurelia-slickgrid#511
Thanks a lot for the help, even if I might have given to little information. |
…umn (#242) - the custom width was not applied to the correct column, when user had a custom width on column 1 it was applied to column 2. The bug was that getGrouping() always return an array and we should check for its length instead (not just if it exist) - fixes issue report in Aurelia-Slickgrid ghiscoding/aurelia-slickgrid#511
This is now fixed and released, however please note that you will have to update both Aurelia-Slickgrid |
I'm submitting a Bug report
Your Environment
Context
I try to setup export to excel, and also set export width for columns.
Expected Behavior
Title should get excel width on 50 point, when exporting.
Current Behavior
Title get default width on "8.43 points" in excel, when exporting.
But next column Duration gets 49.29 points, so it seems like width are of one column.
Possible Solution
What I can see when console.log out sheet from customExcelHeader, some extra header styles (mark with red in image) is set before the real ones. Which makes all columns styles be of one column I think.

Code Sample
The text was updated successfully, but these errors were encountered: