How to upload an Excel sheet file using react.js and display data to a table

I am new to react JS. I am trying to perform uploading Excel sheet file using react.js and display data to a table. I got partial reference from the link but, it is not complete. Please help with it. Importing data from excel and displaying in a react component

You can use the library like https://react-dropzone.js.org/ to upload files and then use https://github.com/felixrieseberg/React-Spreadsheet-Component library to display it.

Use the OutTable component to render obtained JSON data into HTML table, and provide classnames as props to make the table look like an Excel Sheet <OutTable data={this.state.rows} columns={this

We often export data from tables to excel sheets in web applications. There are two ways to implement the export functionality in React: one is by using any third party library, and the other is by creating your component. In this post, we will see how to implement excel export functionality in React app in both ways.

I've had success with this using xlsx to read excel file sheets. Just do something like this:

import excel from 'xlsx';
let fileName = "newData.xlsx";
let workbook = excel.readFile(fileName);
console.log(workbook) //should print an array with the excel file data

assuming a spreadsheet with name 'newData.xlsx' in your root folder. Then its just a matter of figuring out how to access the data you want. This should also be helpful.

Import the excel file in ELN NOTE : The uploading is the only good way to replicate your excel sheets. If you copy-paste the excel sheet in ELN “ spreadsheet” or “ flat spreadsheet” to “ content” , ONLY the table and values will be copied and not the formulas.

When you link to an Excel file, Access creates a new table, often referred to as a linked table. The table shows the data in the source worksheet or named range, but it doesn't actually store the data in the database. You cannot link Excel data to an existing table in the database.

Import data using copy and paste. Now that we’ve imported data from an Excel workbook, let’s import data from a table we find on a web page, or any other source from which we can copy and paste into Excel. In the following steps, you add the Olympic host cities from a table. Insert a new Excel worksheet, and name it Hosts.

React file upload: proper and easy way, with NodeJS! Upload page reloads on submitting a file for upload. Are you a newbie to React, and using this generic style to upload files on the web? There’s a better way to handle uploads in React. This tutorial is the answer!

Comments
  • see this link stackoverflow.com/questions/46909260/…
  • This is great! Dose it support reading data from multiple sheets in the document?
  • I get this error in the console: Uncaught TypeError: _fs.readFileSync is not a function
  • Looking back, I think this only works in Node or some other server side deployment. If you want to use XLSX in the browser you'll have to use a FileReader