Search code examples
excelfileexportreact-bootstrap

How to export react-bootstrap-table-2 data to excel?


I am using the react-bootstrap-table-next in my application. I must export data into excel. Is there a way to do? I am using react-bootstrap-table2-toolkit and was able to export only into CSV format. Can anyone help me how to export into excel ?


Solution

  • By using

         <ToolkitProvider
                  keyField="id"
                  data={products}
                  columns={columns}
                  search
                  exportCSV={{
                    fileName: "file.csv",
                  }}
                >
    

    This has worked.