This is a migrated thread and some comments may be shown as answers.

Export to excel - considering hidden field

9 Answers 147 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kirubakaran
Top achievements
Rank 1
Kirubakaran asked on 22 Apr 2020, 11:09 AM

Attached my code.

Its working fine as expected.

But while i am exporting to excel, the child rows are not showing. because in datasource field i made "Comments" field as hidden. If i remove "hidden" then data is exporting as expected. But i dont want to show this Comments field as parent record.

I tried to use showColumn/hideColumn as mentioned in code. but its not working as expected. Looking your help on this.

 

9 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 24 Apr 2020, 08:44 AM

Hi Kirubakaran,

Find below a modified Dojo sample that exports the hidden column "Comments". After the export, the column is hidden once again. 

https://dojo.telerik.com/aPaGOKaz

The slight blink of the grid is expected behavior since the column actually gets shown and hidden afterward. You might opt for adding an overlay that would hide the blink of interest. 

Let me know in case further assistance is needed.

 

Regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Kirubakaran
Top achievements
Rank 1
answered on 24 Apr 2020, 09:05 AM

Tsvetomir,

I tested the Dojo sample. But child records not exporting. Looking forward your help

0
Tsvetomir
Telerik team
answered on 28 Apr 2020, 08:17 AM

Hi Kirubakaran,

Find the updated Dojo sample that implements the logic for the inner rows export. I have added your code snippet inside the logic for showing the column:

https://dojo.telerik.com/AXAgIkEd

Give this a test and let me know how it works out for you.

 

Regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Kirubakaran
Top achievements
Rank 1
answered on 28 Apr 2020, 08:42 AM

Tsvetomir,

While i am clicking export button, still i didnt get the child records. The excel sheet contains only the parent rows with comments (which i expected).

But child rows not getting in excel. Expecting your help

0
Tsvetomir
Telerik team
answered on 28 Apr 2020, 06:31 PM

Hi Kirubakaran,

Indeed, the export of the hierarchy is not available out-of-the-box. This is due to the fact that the main grid cannot be responsible for triggering the export event for the child records. Even if that was possible, all of the grids would have been exported to different files. 

In order to export a grid with its child grids, incorporate the example that has been demonstrated in the following forum thread:

https://www.telerik.com/forums/excel-export-of-multiple-detail-levels

Let me know in case assistance in the incorporation is needed.

 

Regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Kirubakaran
Top achievements
Rank 1
answered on 06 May 2020, 10:12 AM

Tsvetomir,

I already gone through it and i cannot modify my code as per that detailed export. Thats why i am here to get help.

Anyways, i will put more effort and try to implement this.

Thanks

0
Tsvetomir
Telerik team
answered on 08 May 2020, 08:46 AM

Hi Kirubakaran,

The approach that has been provided in the forum thread is the only one that could be undertaken. This is due to the fact that the two master and child grids are decoupled and do no know about each other. Also, in order to concatenate the two into only one Excel file, the outputs of the inner grids should be dynamically appended to the Workbook of the parent grid. 

The provided Dojo sample exposes JavaScript logic that is rather generic and it is highly likely that further modifications will not be needed. I believe that you could use it as-is in your project.

Feel free to get back to me in case additional information is needed.

 

Regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Kirubakaran
Top achievements
Rank 1
answered on 08 May 2020, 11:34 AM

Tsvetomir,

My code

Thanks & as per your help, i re-use that code & tried to implement my export functionality. But here i am getting only the header as my child entry. Looking forward your help on this.

Thanks

0
Accepted
Tsvetomir
Telerik team
answered on 12 May 2020, 08:14 AM

Hi Kirubakaran,

Thank you for the provided sample project. I have investigated it and I have noticed that the data source for the Kendo Exporter has not been actually set to the "Comments" of the parent row. Check out the modified version here:

https://dojo.telerik.com/EnUkOgOY

 

Regards,
Tsvetomir
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
Kirubakaran
Top achievements
Rank 1
Answers by
Tsvetomir
Telerik team
Kirubakaran
Top achievements
Rank 1
Share this question
or