Grid Excel Export Setting Grid Data in Specific Row or Columns

1 Answer 136 Views
Grid
CHIHPEI
Top achievements
Rank 2
Iron
Iron
Iron
CHIHPEI asked on 04 Jan 2022, 08:26 AM

Scenario pic

Hi everyone,

I would like to know is it possible to export grid data to specific row and columns via through  excelExportHandler? (As the provided Pic)

I've noticed that we could use jquery to set background color of the excel file,

Would this solve my question?

 

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 06 Jan 2022, 06:18 PM

Hello Chihpei,

Yes, you are on the right track. You can use the workbook field exposed by the Grid's ExcelExport event to style the exported .xlsx file. 

For your convenience I am applying a sample REPL that showcases the Styling of the Grid's Excel Export.

Please let me know should further questions arise.

Regards,
Stoyan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

CHIHPEI
Top achievements
Rank 2
Iron
Iron
Iron
commented on 07 Jan 2022, 08:47 AM

Hi Stoyan,

Thanks for helping out and providing the sample,

I've checked the documents and also the structure of the event data,

I havn't started a test, but based on the things I knew,

We could be able to

=> get Grid data from "e.data",

and in the next step, by calling "e.workbook.sheets[0].rows" to fill in the data(e.data) to our desired rows and cells

Am I right?

Again thanks for the help!

Regards,

Chihpei

Stoyan
Telerik team
commented on 12 Jan 2022, 08:30 AM

Hi Chihpei,

It is possible to add additional rows to the exported table, however the Grid does this internally for its data when the ExcelExport event is called.

That being said I have updated the REPL Styling of the Grid's Excel Export example I shared before as the previous link contains an earlier version that doesn't work correctly.

I hope the information above is helpful in the scenario at hand.
Tags
Grid
Asked by
CHIHPEI
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Stoyan
Telerik team
Share this question
or