SpreadSheet Load CSV /XLS

1 Answer 73 Views
Spreadsheet
Sergio
Top achievements
Rank 1
Sergio asked on 05 May 2022, 09:42 AM

I'm trying to import form a file with diferent format

 

 

The samples I fount relate do CsvFormatProvider ou XlsFormatProvider tha return a Workbook.

How do I link the retrun workbook to my kendo UI control=

            var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
            fileName = "SOME_FILE.CSV";

             if (!File.Exists(fileName)) {
                throw new FileNotFoundException(String.Format("File {0} was not found!", fileName));
            }
            formatProvider = new CsvFormatProvider();

            using(input = new FileStream(fileName, FileMode.Open))
            {
                workbook = formatProvider.Import(input);
            }

           Spreadsheet.?? = workbook

           

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 10 May 2022, 06:47 AM

Hello Sergio,

If you need to import and export files in Spreadsheet on the server I will recommend taking a look at the endpoint implementation in the Server Import/Export Demo:

- https://demos.telerik.com/kendo-ui/spreadsheet/server-side-import-export

For example, you could take a look at the controllers used for the same demo for the UI for ASP.NET MVC suite. You can click on the 'View Source' tab - > Server_Side_Import_ExportController.cs and review the implementation. 

I hope this helps. 

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

Tags
Spreadsheet
Asked by
Sergio
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or