Open Bilal-Abbas opened 4 years ago
Having the same issue
xlsx.js:4334 Uncaught TypeError: Cannot read property 'match' of undefined
at write_sst_xml (xlsx.js:4334)
at write_sst (xlsx.js:8914)
at write_zip (xlsx.js:11783)
at write_zip_type (xlsx.js:11859)
at Object.writeSync [as write] (xlsx.js:11873)
at ExcelFile.download (ExcelFile.js:104)
at HTMLUnknownElement.callCallback (react-dom.development.js:336)
at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
at invokeGuardedCallback (react-dom.development.js:440)
at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:454)
at executeDispatch (react-dom.development.js:584)
at executeDispatchesInOrder (react-dom.development.js:606)
at executeDispatchesAndRelease (react-dom.development.js:713)
at executeDispatchesAndReleaseTopLevel (react-dom.development.js:722)
at forEachAccumulated (react-dom.development.js:694)
at runEventsInBatch (react-dom.development.js:739)
at runExtractedPluginEventsInBatch (react-dom.development.js:880)
at handleTopLevel (react-dom.development.js:5803)
at batchedEventUpdates$1 (react-dom.development.js:24401)
at batchedEventUpdates (react-dom.development.js:1415)
at dispatchEventForPluginEventSystem (react-dom.development.js:5894)
at attemptToDispatchEvent (react-dom.development.js:6010)
at dispatchEvent (react-dom.development.js:5914)
at unstable_runWithPriority (scheduler.development.js:697)
at runWithPriority$2 (react-dom.development.js:12149)
at discreteUpdates$1 (react-dom.development.js:24417)
at discreteUpdates (react-dom.development.js:1438)
at dispatchDiscreteEvent (react-dom.development.js:5881)
Ok, I got mine bug - one of the values in dataset was 'undefined', so this error was triggered
Any luck?
Yeah. I will send you the trick in a moment :)
Following data formulation worked for me.
const data = [ { columns: [title: "Title"], data: [ [value: "Value"] ] } ]
That is
const data = [
{
columns: [
{ title: "Order #" },
{ title: "Customer" },
{ title: "Ref #" },
{ title: "Status" },
{ title: "Total" },
{ title: "Sub Total" },
{ title: "Order Time" },
{ title: "Items Count" },
],
data: csvData.map((order, index) => {
return [
{ value: order.order_no },
{ value: order.customer_name },
{ value: order.ref_id},
{ value: this.getStatusName(order) },
{ value: order.total.toFixed(2) },
{ value: humanizeT(order.order_time) },
{ value: order.customer_name },
{ value: order.order_item_count },
];
}),
},
];
Import stuff
import ReactExport from "react-data-export";
const ExcelFile = ReactExport.ExcelFile;
const ExcelSheet = ReactExport.ExcelFile.ExcelSheet;
With dry code
<ExcelFile element={<button>Happy React</button>}>
<ExcelSheet dataSet={data} />
</ExcelFile>
Hope this will work :+1:
@Bilal-Abbas Thanks.. Its working :)
hey guys, just have another similar error - "Cannot read property 'match' of null", and it was because one of the {value: null} in multidataset.
So, just to sum up - all value's in your dataset must be not undefined and not null. If it is – there will be an error and code will break
Hey guys, facing another similar error. "Cannot read property match of undefined" , only when i provide style attribute in the dataset. Any idea why it might be happening?
I tried the example from https://github.com/securedeveloper/react-data-export/blob/HEAD/examples/simple_excel_export_02.md
But I am getting below error, Can some please help ?
xlsx.js:4334 Uncaught TypeError: Cannot read property 'match' of undefined at write_sst_xml (xlsx.js:4334) at write_sst (xlsx.js:8914) at write_zip (xlsx.js:11783) at write_zip_type (xlsx.js:11859) at Object.writeSync [as write] (xlsx.js:11873) at ExcelFile.download (ExcelFile.js:104) at HTMLUnknownElement.callCallback (react-dom.development.js:336) at Object.invokeGuardedCallbackDev (react-dom.development.js:385) at invokeGuardedCallback (react-dom.development.js:440) at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:45
I tried the example from https://github.com/securedeveloper/react-data-export/blob/HEAD/examples/simple_excel_export_02.md
But I am getting below error, Can some please help ?
xlsx.js:4334 Uncaught TypeError: Cannot read property 'match' of undefined at write_sst_xml (xlsx.js:4334) at write_sst (xlsx.js:8914) at write_zip (xlsx.js:11783) at write_zip_type (xlsx.js:11859) at Object.writeSync [as write] (xlsx.js:11873) at ExcelFile.download (ExcelFile.js:104) at HTMLUnknownElement.callCallback (react-dom.development.js:336) at Object.invokeGuardedCallbackDev (react-dom.development.js:385) at invokeGuardedCallback (react-dom.development.js:440) at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:45
Same issue.
same issue here with this example https://github.com/securedeveloper/react-data-export/blob/HEAD/examples/simple_excel_export_02.md
same issue here with this example https://github.com/securedeveloper/react-data-export/blob/HEAD/examples/simple_excel_export_02.md
Did anybody find solution?
Following data formulation worked for me.
const data = [ { columns: [title: "Title"], data: [ [value: "Value"] ] } ]
That is
const data = [ { columns: [ { title: "Order #" }, { title: "Customer" }, { title: "Ref #" }, { title: "Status" }, { title: "Total" }, { title: "Sub Total" }, { title: "Order Time" }, { title: "Items Count" }, ], data: csvData.map((order, index) => { return [ { value: order.order_no }, { value: order.customer_name }, { value: order.ref_id}, { value: this.getStatusName(order) }, { value: order.total.toFixed(2) }, { value: humanizeT(order.order_time) }, { value: order.customer_name }, { value: order.order_item_count }, ]; }), }, ];
Import stuff
import ReactExport from "react-data-export"; const ExcelFile = ReactExport.ExcelFile; const ExcelSheet = ReactExport.ExcelFile.ExcelSheet;
With dry code
<ExcelFile element={<button>Happy React</button>}> <ExcelSheet dataSet={data} /> </ExcelFile>
Hope this will work 👍
How to download multiple sheet in one excel file?
I am getting so many errors Any help? )
2index.js:23 Error: Request failed with status code 403 at createError (createError.js:16) at settle (settle.js:17) at XMLHttpRequest.onloadend (xhr.js:66)
@Bilal-Abbas It's working.
I got stuck with the above issue. any help? My code is