I have notice when exporting a groupped grid to excel the aggregate cells in excel are offset for some reason to the left and do not match the browser grid aggregate layout and as such the exported file doesnt look as good as it should.
This can behavior can easily be replicated in the kendo demo page at http://demos.telerik.com/kendo-ui/grid/excel-export
6 Answers, 1 is accepted
Excel export doesn't currently apply any alignment out of the box. To align the cell text you need to customize the output file and set the hAlign attribute of the required cells.
Yes alignment is one thing but im talking about the exported cell offset mismatch. For example in the kendo excel export demo page add an additional groupping by 'Product Name' then under column 'Units On Order' there will be 2 rows of aggregates for Average. All good till here but when exported to excel the Average cell is offseted to the left and appears under 'Unit Price' column instead of 'Units On Order' as it should be per kendo grid.
I see what you mean. This actually is a bug rather than misalignment. There is one cell missing during nested grouping. I've landed a fix for this and it will be part of the next internal build.Regards,
Sounds great and looking forward for the fix!
Looking at the demo mentioned in the 1st post (http://demos.telerik.com/kendo-ui/grid/excel-export) it appears that the alignment issue still exists when the export is done as of 5/16/2017. When I do an export from the demo url, the aggregate cell is offset to left while the column cells are aligned to the right.
Is this still an issue or am I looking at this incorrectly?
I believe that the missing cell issue has been fixed. I did a test with Kendo UI from 2015 before the fix was pushed by my colleague following the steps Cornel mentions, i.e.
- add an additional grouping by 'Product Name' then under column 'Units On Order', there will be 2 rows of aggregates for Average.
- when exported to excel the Average cell is offset to the left and appears under 'Unit Price' column instead of 'Units On Order'
Result in Excel:
If you test the same grid with the current version, the output is as expected:
Here is the demo with the latest version I used:
For the complete list of cell properties, please check the Kendo UI Workbook namespace:
Finally, if you are referring to the cell alignment - the default excel behaviour is to align text to the left and numbers to the right based on their type:
Telerik by Progress