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

Spreadsheet Worksheet to Datatable

1 Answer 937 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
Indy
Top achievements
Rank 1
Veteran
Indy asked on 07 Apr 2020, 02:34 PM

Hi, I am using Telerik.Web.Spreadsheet to load an Excel sheet.  I would like to return the Excel sheet as a datatable, I cant see a property on how to do this.  Any ideas would be much appreciated.  Below is my code thus far:

        Dim ExcelPath As String = "C:\Test\Test.xlsx"
        Dim WorkBook As Telerik.Web.Spreadsheet.Workbook = Telerik.Web.Spreadsheet.Workbook.Load(ExcelPath)
        Dim ws As Telerik.Web.Spreadsheet.Worksheet = WorkBook.Sheets(0)

Many thanks in advance

 


1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 10 Apr 2020, 10:02 AM

Hi,

You can iterate through the Worksheets and the cells inside to obtain their values and then transfer them in a DataTable object.

You can convert the Ajax spreadsheet to DocumentProcessingLibrary one as explained below:

 

You can also import the file directly to the DocumentProcessingLibrary:

Direct conversion is currently unavailable and we have logged a task to implement it. I added an additional vote for the item on your behalf to increase its priority.

You can subscribe to the item if you would like to receive updates about status changes on it:

Regards,
Peter Milchev
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
Spreadsheet
Asked by
Indy
Top achievements
Rank 1
Veteran
Answers by
Peter Milchev
Telerik team
Share this question
or