Some excel file exported from some platform or system,when i use XLSX.read(),i found the excel content be splited,after I printed control+s,then XLSX.read() can be work correctly #2980

Closed
opened 2023-09-01 01:35:38 +00:00 by guiyuxuan · 3 comments
No description provided.
Owner

That file was generated by Apache POI.

Relevant SheetJS issue SheetJS/sheetjs#2011

Relevant Apache POI upstream issue https://bz.apache.org/bugzilla/show_bug.cgi?id=64536

There is an undocumented option nodim that you can pass to XLSX.read:

  const workbook = XLSX.read(result, { type: 'binary', nodim: true });

If this works for you, we will consider making that option official.

That file was generated by Apache POI. Relevant SheetJS issue https://git.sheetjs.com/SheetJS/sheetjs/issues/2011 Relevant Apache POI upstream issue https://bz.apache.org/bugzilla/show_bug.cgi?id=64536 There is an undocumented option `nodim` that you can pass to `XLSX.read`: ```js const workbook = XLSX.read(result, { type: 'binary', nodim: true }); ``` If this works for you, we will consider making that option official.
Owner

The workaround not using the undocumented option is https://docs.sheetjs.com/docs/miscellany/errors#worksheet-only-includes-one-row-of-data

Unrelated comment about the screenshotted code: if you only need to support modern Chrome, you can use the arrayBuffer method of File or Blob. It is explained in more detail in the "Blob and File" section of "Local File Access" in the docs

The workaround not using the undocumented option is https://docs.sheetjs.com/docs/miscellany/errors#worksheet-only-includes-one-row-of-data Unrelated comment about the screenshotted code: if you only need to support modern Chrome, you can use the `arrayBuffer` method of `File` or `Blob`. It is explained in more detail in the ["`Blob` and `File`" section of "Local File Access" in the docs](https://docs.sheetjs.com/docs/demos/local/file#blob-and-file)
Owner

A note about nodim was added to the docs: https://docs.sheetjs.com/docs/api/parse-options#range

A note about `nodim` was added to the docs: https://docs.sheetjs.com/docs/api/parse-options#range
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#2980
No description provided.