Do you have sample code that would allow me to upload a spreadsheet and read it, looping through each row and column using built-in functions/procedures from Telerik UI for ASP.NET?
I see you have samles in: http://demos.telerik.com/aspnet-core/spreadsheet/index. None of them though show how to upload the file and read the file using Telerik UI for ASP.net. Please advise
17 Answers, 1 is accepted
Hello Jose,
Yes, you can check out this demo here: http://demos.telerik.com/kendo-ui/spreadsheet/server-side-import-export.
Regards,Ianko
Telerik by Progress

Hello Jose,
If I understand you properly, the Kendo Spreadsheet component is actually never used and the topic here addresses server-side processing of Spreadsheet documents. For processing documents on the server, we offer the Telerik Document Processing library (http://docs.telerik.com/devtools/document-processing/introduction). And for spread processing, you can navigate here: http://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/overview. However, Telerik Document Processing still does not NET Core: http://docs.telerik.com/devtools/document-processing/installation-and-deployment/system-requirements.
The Kendo Spreadsheet widget and ASP.NET Core component utilize client-side funcitonality for importing and exporting Excel files. http://docs.telerik.com/kendo-ui/controls/data-management/spreadsheet/import-and-export-data/server-side-processing. Server-side processing is again supported only for the non-Core .NET Framework.
Regards,Ianko
Telerik by Progress

How do I show a xlsx file in asp.net core
Do i have to convert it to json first?
That would be the best option currently if you have a service that transforms an Excel file to JSON. The Document Processing libraries does not support .NET Core yet.
Regards,
Ianko
Progress Telerik

The component itself can load Excel data when, but as this is a client-side widget you cannot somehow feed it with a stream of Excel file. The data should be client-side compatible. For MVC scenarios we have the option to use the Document Processing libraries. The Core support is under development and you can track its status here: https://feedback.telerik.com/Project/184/Feedback/Details/198399-document-processing-provide-version-for-net-core.
Regards,
Ianko
Progress Telerik

Why can I do this i .net core
@{var path = Server.MapPath("~/App_Data/path/to/document.xlsx");
var workbook = Telerik.Web.Spreadsheet.Workbook.Load(path);}
@(Html.Kendo().Spreadsheet().Name("spreadsheet").BindTo(workbook))
The Telerik.Web.Spreadsheet assembly is available only with the Kendo UI for ASP.NET MVC. It is not shipped with the Kendo UI for ASP.NET Core suite. This is because the Telerik.Web.Spreadsheet assembly depends on the Telerik Document Processing libraries that currently are not supported in .NET Core.
Regards,
Ianko
Progress Telerik

The original feature request on this task is logged here: https://feedback.telerik.com/Project/184/Feedback/Details/198399-document-processing-provide-version-for-net-core. You can follow it by clicking Follow this item. That way you will get notifications on updates. You can also post a comment on the thread with any additional feedback that you have in mind.
Regards,
Ianko
Progress Telerik

The Document Processing libraries does not support json
so I cant use it to convert excel files to json
How can I show Excel fil in .net core when You dont have a way to convert files to the only format the control support?
When the Document Processing libraries are supported for .NET Core, the Telerik.Web,Spreadsheet assembly will be shipped along with the Telerik UI for ASP.NET Core suite just like it is now with the MVC suite (https://demos.telerik.com/aspnet-mvc/spreadsheet/server-side-import-export). That will enable xlsx import and export out of the box without the hassle to take car of JSON conversion on your own.
Shortly, in the MVC suite, it is the Telerik.Web.Spreadsheet assembly that makes that conversion and handles xlsx files by utilizing the Document Processing libraries.
Regards,
Ianko
Progress Telerik

I found a way to load a Excel file from server i .net Core
var xhr = new XMLHttpRequest();
xhr.open('GET', '/Dokumenter/Drejebog/EntreRegler.xlsx', true);
xhr.responseType = 'blob';
xhr.onload = function (e) {
if (this.status == 200) {
// get binary data as a response
var blob = this.response;
var spreadsheet = $("#spreadsheet").data("kendoSpreadsheet");
spreadsheet.fromFile(blob);
}
};
xhr.send();

It's the end of 2020 and still no examples for Server Import/Export in ASP.NET Core Spreadsheet. Also I can't find the Telerik.Web,Spreadsheet assembly that Ianko mentioned.
What I like to do is:
1. Load an Excel-file from server and display it in ASP.NET Core Spreadsheet Component (inside Get-method of PageModel); this means I have to somewhat bind the file from my PageModel to the component
2. Let user change some cells
3. Save the file in a database and reload it later on from there.
How can this be achieved?
Regards
Heiko

Heiko,
I found this in the 2020.3.195 release: https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/formats-and-conversion/import-and-export-to-excel-file-formats/xlsx/xlsxformatprovider. My issue is I can't figure out how to process it. All the examples are for making a workbook, not reading one.
Telerik.Windows.Documents.Spreadsheet.Model.Workbook workbook;
IWorkbookFormatProvider formatProvider =
new
Telerik.Windows.Documents.Spreadsheet.FormatProviders.OpenXml.Xlsx.XlsxFormatProvider();
using
(Stream input =
new
FileStream(fileName, FileMode.Open))
{
workbook = formatProvider.Import(input);
}

Hi Scott,
thanks for your input. I use the document processing libraries from Telerik in other projects so: yes, I know how to load and save a file via FormatProviders, but the missing link is how to connect the workbook with the spreadsheet component.
I took your example from above (30 Oct 2018) and it works quite good, except for all values in my cells are gone. Formatting and formulas are ok, but the rest of the sheet is empty. I'm considering switching to a different component from another provider.
Regards
Heiko