No selection status information in exported excel file

1 Answer 39 Views
Excel Export General Discussions Grid
Hu
Top achievements
Rank 1
Iron
Iron
Iron
Hu asked on 29 Jan 2024, 06:58 AM

Hello
I'm having trouble using the Kendo mesh export feature
There is no selection status information in the "Selected" column of the exported file, which is always empty.
Is it possible to show selection status in exported files?

Axv86s (forked) - StackBlitz

Regards,
Sunny

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 30 Jan 2024, 05:58 PM

Hi Sunny,

In the export function, you are passing the "products" data, which does not contain any information about the selected state. Please have in mind that the excel export does not export cell templates and only the underlying data item values. With that in mind, you can set the selected value to the exported data:

  const exportExport = () => {
    if (_export.current !== null) {
      _export.current.save(
        products.map((item) => {
          return {
            ...item,
            [SELECTED_FIELD]: selectedState[idGetter(item)] ? true : false,
          };
        })
      );
    }
  };

Here is the updated example:

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Hu
Top achievements
Rank 1
Iron
Iron
Iron
commented on 04 Feb 2024, 06:56 AM

Hi Konstantin,

Thanks for your feedback. And I have another question when trying the export function from my end, for the "Selected" checkbox column, if we display this column in UI, then customize the other exported columns, the exported result is will not list as expected. But if not display the "Selected" checkbox column in UI, then we customized other exported columns, it works well. Do you know what cause the difference? Is it component limitation or I misunderstand anything?

Regards,
Sunny

Selected column exists

Axv86s (forked) - StackBlitz

No selected column
Zzwzrm (forked) - StackBlitz

Konstantin Dikov
Telerik team
commented on 06 Feb 2024, 11:53 AM

Hi Sunny,

In the example with the issue you are not setting the "data" property for the ExcelExport:

<ExcelExport data={data} ref={_export}>

Additionally, if you want to export the select column you will have to include ExcelExportColumn with the selected field:

Tags
Excel Export General Discussions Grid
Asked by
Hu
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or