You can export data even in Internet explorer by using this library.
react-data-export
usage of this package is simple,
const dataSet1 = [
{
name: "Johson",
amount: 30000,
sex: 'M',
is_married: true
},
{
name: "Monika",
amount: 355000,
sex: 'F',
is_married: false
},
{
name: "John",
amount: 250000,
sex: 'M',
is_married: false
},
{
name: "Josef",
amount: 450500,
sex: 'M',
is_married: true
}
];
and to export this dataSet,
import React from "react"
import * from "react-data-export"
class App extends React.Component {
const dataSet1 = [
{
name: "Johson",
amount: 30000,
sex: 'M',
is_married: true
},
{
name: "Monika",
amount: 355000,
sex: 'F',
is_married: false
},
{
name: "John",
amount: 250000,
sex: 'M',
is_married: false
},
{
name: "Josef",
amount: 450500,
sex: 'M',
is_married: true
}
];
render() {
return (
<ExcelFile>
<ExcelSheet data={dataSet1} name="Employees">
<ExcelColumn label="Name" value="name" />
<ExcelColumn label="Wallet Money" value="amount" />
<ExcelColumn label="Gender" value="sex" />
<ExcelColumn label="Marital Status"
value={(col) => col.is_married ? "Married" : "Single"} />
</ExcelSheet>
</ExcelFile>
);
}
}
let me know if it works for you.