Grid exportSelectedToExcel() issue

1 Answer 34 Views
Grid
Laurent
Top achievements
Rank 2
Iron
Iron
Laurent asked on 10 Sep 2021, 03:11 PM

Hi team,

This dojo to illustrate the problem: https://dojo.telerik.com/inukEneV

In this dojo, i want to export selected rows to excel with exportSelectedToExcel(true). Rows are selected by clicking checkboxes.

What I experience:

- Column headers are duplicated in excel file, one for each row when selecting row with checkboxes. When selecting rows by dragging the mouse (not clicking the checkbox), it seems to work. (screenshot 1)

- Many times, when selecting rows by clicking checkbox mixed with dragging mouse to select, I can get an excel file with rows that were not selected! (screenshot2) Quite strange.

Please advise,

Best regards,

Laurent.

 

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 15 Sep 2021, 11:58 AM

Hello Laurent,

Thank you for the Dojo demo and images provided.

Actually, the pointed behavior is expected. The exported items are considered separate ones. This is the reason for the duplicated headers.

The exportSelectedToExcel method of the Kendo UI Grid receives a boolean parameter in order to include a header for every exported item, or to exclude the headers(if exportSelectedToExcel(false)).

To avoid duplication of the headers, you could use a custom function that maps the selected rows in a kendo.ooxml.Workbook and export them via kendo.saveAs() method. Below I am posting a Dojo demo demonstrating this:

Regarding the second question, I was not able to replicate it. Could you please share step by step how this is replicable?

Hope this helps.

Regards,


Nikolay
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Laurent
Top achievements
Rank 2
Iron
Iron
commented on 16 Sep 2021, 09:24 AM

Hi Nikolay,

Thank you for the prompt response.

To reproduce the second point, just make successive exports by selecting different rows each time, and then you'll get something like screenshot 2.

Best regards

Laurent

Nikolay
Telerik team
commented on 21 Sep 2021, 09:27 AM

Hi Laurent,

I am still investigating. Please expect a follow-up shortly.

Regards,

Nikolay

Nikolay
Telerik team
commented on 19 Jan 2022, 04:13 PM

Hi Laurent,

Sorry for the late reply.

Did you manage to resolve the export problem? If not could you please record a screencast demonstrating how the issue is replicable?

Regards,

Nikolay

Laurent
Top achievements
Rank 2
Iron
Iron
commented on 20 Jan 2022, 05:56 PM

Hi Nikolay,

No, the problem is still there.

Sorry, but I can't make a screencast.

Here is how you can reproduce the issue:

1- select a bunch of lines by dragging the mouse (screenshot 1).

2- unselect some lines by clicking their checkboxes (screenshot 2)

3- export selected to excel and see the difference (screenshot 3).

 

Best regards,

Laurent.

Georgi Denchev
Telerik team
commented on 25 Jan 2022, 01:07 PM

Hi, Laurent,

Thank you for the provided screenshots and details. This behavior does indeed look like a bug and I've logged an issue in our public GitHub repository that you can track for progress:

https://github.com/telerik/kendo-ui-core/issues/6692 

I've also updated your Telerik Points as a sign of gratitude for bringing this issue to our attention.

Until the problem is resolved, you should avoid using drag selection with checkbox selection. Please accept my apologies about the caused inconvenience.

Tags
Grid
Asked by
Laurent
Top achievements
Rank 2
Iron
Iron
Answers by
Nikolay
Telerik team
Share this question
or