sheetjs icon indicating copy to clipboard operation
sheetjs copied to clipboard

xlsb errors #1140

Open WorkMAE opened this issue 8 years ago • 6 comments

@SheetJSDev I already tried what was recommended in XHR for this, but that doesn't work with XLSB files, only with XLSX.

Using an "arrayBuffer" as the responseType returns as null. I get the data back when I change it to "binary" however, returning a Uint8Array gives an empty array.

When I try and read it in directly from the req.reponse using the various types, that doesn't work either.

Maybe you should specifically put an example with a XLSB file on there since it appears to be more difficult and has no real documentation anywhere? I can't use n XSLX or CSV file as it greatly increases the file size.

WorkMAE avatar Jun 18 '18 21:06 WorkMAE

There should be no difference. If the mechanism works for XLSX it should equally work for XLSB.

Can you view the XLSB file in the preview at https://oss.sheetjs.com/ (download the file manually then click and drag into the box in the window)? If you can, then there's likely an integration issue.

Also, can you share the offending XLSB file and the good XLSX file? You can attach in an email to dev at sheetjs dot com.

SheetJSDev avatar Jun 18 '18 21:06 SheetJSDev

It does work on the website version...I will go check the code out

CodeLiftSleep avatar Jun 18 '18 22:06 CodeLiftSleep

One more place to look: if it's working with an XLSX file but you think it isn't working with an XLSB file, is the XLSB request 404'ing? Try to inspect the XHR response and make sure you are actually getting the file.

SheetJSDev avatar Jun 18 '18 23:06 SheetJSDev

Now it is giving me data with using the new Uint8Array(req.response) line but when I use XLSX.read(data, {type: 'array'}) it throws:

"Uncaught TypeError: jszip is not a constructor"

WorkMAE avatar Jun 19 '18 00:06 WorkMAE

OK got it to work...had to switch from xslx.js to full.min.js

WorkMAE avatar Jun 19 '18 00:06 WorkMAE

Good to hear!

SheetJSDev avatar Jun 19 '18 01:06 SheetJSDev