I've been attempting to create an excel export feature, but for some unknown reason, it's not functioning properly. I'm utilizing react-data-export and followed a small test example from this GitHub link, yet the export is not working as expected.
Here is the button I have created:
<Button
startIcon = {<FileDownloadIcon />}
variant = "contained"
color = "success"
size = "medium"
onClick={exporExcel} >
Export Excel
</Button>
And here is the function I am using:
const exporExcel = () => {
<ExcelFile>
<ExcelSheet data = {pedidos} name = "Prueba">
<ExcelColumn label="# Pedido" value="id"/>
<ExcelColumn label="Estudiante" value="nombre"/>
<ExcelColumn label="Colegio" value="escuela"/>
<ExcelColumn label="Grado" value="grado"/>
</ExcelSheet>
</ExcelFile>
};