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

What's the best way to export/import a DataTable object to Excel?

1 Answer 1258 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nicholas
Top achievements
Rank 1
Nicholas asked on 22 Mar 2018, 02:00 PM

So I have a DataTable object that has data with rows & columns. My question is do I convert that into a RadGridView and then try to export it to Excel? Is that the easiest way to do it? Or is there another way I can export the DataTable object without having to convert it to a RadGridView? If so, how can I go about doing that? Is it using RadSpreadStreamProcessing library?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Mar 2018, 01:15 PM
Hello, Nicholas, 

Converting a DataTable to an Excel file is more like a general programming question. Hence, I would recommend you to have a look at forums like MSDN and StackOveflow for additional information. The following threads are quite useful on this topic:
https://stackoverflow.com/questions/8207869/how-to-export-datatable-to-excel
https://social.msdn.microsoft.com/Forums/vstudio/en-US/ab1e15ef-8020-4ff6-9a84-2a728737b0e9/export-dataset-to-excel-on-winform?forum=csharpgeneral
https://www.codeproject.com/Questions/662975/Export-Datatable-to-excel

As to the RadGridView control, you can bind it to a DataTable and then use the GridViewSpreadExport.

I hope this information helps. If you have any additional questions, please let me know. 

Regards,
Dess
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Nicholas
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or