Grid with excel export function

1 Answer 145 Views
Grid
CHIHPEI
Top achievements
Rank 2
Iron
Iron
Iron
CHIHPEI asked on 28 Dec 2021, 05:15 AM

Hi everyone,

I'm aware of there is WordProcessing component for processing documents.

I've also notice that in grid demo there are functions for exporting Excel and PDF.

Is there a  solution for exporting Microsoft .docx documentation?

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 30 Dec 2021, 11:19 AM

Hi Chihpei,

To export a Word document I would suggest any of the following approaches:

  • The Editor provides MS Word import/export feature demonstrated in this online demo:

https://demos.telerik.com/aspnet-core/editor/import-export

 

This sample is for the AJAX toolset, however, the C# DPL code will be the same in Core suites, too.

In addition, this topic has been discussed in the following forum thread:

https://www.telerik.com/forums/export-html-to-word

Hopefully, this information will be helpful.

 

Regards, Mihaela 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/.

CHIHPEI
Top achievements
Rank 2
Iron
Iron
Iron
commented on 04 Jan 2022, 06:18 AM

Hi Mihaela,

thanks for the information,

I've checked out the editor documentation,

and there was a Tools function option.

I'm curios about another scenario.

Scenario
A page with a Grid and a Editor,
and the Editor could get the data from the Grid by clicking Custom Tool Button or something else,
after the data were generated on the Editor,
I'll export it into files(pdf / excel etc.)
Is the "getting data from grid" idea possible?
Or Is there a limitation?

 

Mihaela
Telerik team
commented on 06 Jan 2022, 01:39 PM

Indeed, you could get the grid's data by accessing its dataSource. For example:

 .CustomButton(x => x.Name("custom").ToolTip("Insert a grid data").Exec(@<text>
                    function(e) {
                      var editor = $(this).data("kendoEditor");
                      var grid = $("#grid").data("kendoGrid"); //get an instance of the grid
                      var gridData = grid.dataSource.view(); //use the view() method of the DataSource to get the data items which correspond to the current page. Alternatively, call the data() method, which will return the data items from all pages, if local data binding and paging are used.
                      editor.value("name:" + gridData[0].name); //insert the value of the Model property "name" of the first data item. You could loop through all data items and extract the desired data
                    }
            </text>))

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