Excel to JSON from Blazor UI

0 Answers 363 Views
Upload
Artem
Top achievements
Rank 1
Veteran
Artem asked on 02 Nov 2021, 05:49 PM

Requirement:

Blazor UI web app -> user select and upload excel file

Blazor UI web app -> convert this excel into JSON (column names to properties, column values to values)

Question:

What would be the best way to achieve this? Is there any component/library that we can use?

 

Thanks,

Artem

 

 

Dimo
Telerik team
commented on 05 Nov 2021, 10:00 AM

Hello Artem,

The uploading part can be done with our Blazor Upload component.

Once you have the file on the server, you can use another product of ours - the Telerik Document Processing library:

  1. Import the Excel file using the XlsxFormatProvider
  2. Iterate the cells and get the cell values.
  3. Use the features built in the System.Text.Json namespace to serialize the object to JSON

No answers yet. Maybe you can help?

Tags
Upload
Asked by
Artem
Top achievements
Rank 1
Veteran
Share this question
or