Support for Older Browsers (IE8) #88
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#88
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I have been at it for a full day now with no luck, so I am turning to you(all) for help.
I am a mechanical engineer with an interest in coding. I am trying to parse data from an excel spreadsheet. Right now I don't think I care if it is XLS, XLSX, or XLSM. My roadblock appears to be my browser. I am working with IE8, running server-side Javascript.
Up until now, I was working with an excel file that automatically generated CSV files at Save, and I was using Javascript to parse the CSV files using XMLHttpRequest(). It seems you have eliminated the need to create extra CSV files.
So, to my point, I believe the fault is fully with me, but I was hoping you could help get my code working. I recognize that IE8 does not support Uint8Array and I need some sort of workaround. From what I can tell, you have already resolved this and I am just not implementing it correctly. I think I need to be working with the Base64 format . . . but I have no idea how to do that. As I understand it, jszip.js will do that for me and I just have to figure out how to do that. I thought I read that the shim resolved this issue, but I still get (Uint8Array is underfined).
Thanks for any help!
Here is my code, which is really your code with paths to your libraries:
It saddens me to hear that you spent a full day at this before reaching out :/ we don't bite (or at least I haven't been known to bite) and I hope that we haven't given any impression that we don't like to answer questions. I am not in front of a computer, but it looks like the README links to an example at http://oss.sheetjs.com/js-xlsx/ajax.html . Does that work for you? To be honest, I really wouldn't be surprised if it didn't work -- I don't recall testing it on IE8. To clarify what is meant by supporting older browsers: I tested with small workbooks using the base64 mode at http://oss.sheetjs.com/js-xls and http://oss.sheetjs.com/js-xlsx . I have not tested the other demos in IE 8 (which is why asking questions earlier is better :) and most likely IE8 doesn't support some XHR feature that the demo uses. If the demo doesn't work, let me know and I'll take a look in a few hours.
Thanks for the fast reply. I am back in front of my computer. I tried the example, in IE8 but had no luck. I have Chrome running as well, which worked fine. I also ran the stress test on IE8 and had no luck. I am able to use XMR to open CSV files. It seems like the trouble is with binary arrays - hence the Base64 workaround. I am not familiar with Base64 and can't find enough detail to even convert an XSL/XLSX/XLSM file to a Base64 string to test it in IE8. Do I just need to call a Base64 encoder from jszip.js?
Thanks again for the help!
I'm okay trying to grind out a solution before calling for help, but I'll try not to wait so long next time . . .
-Mike
Let's test the base64 first (to see if there's a library issue or a file issue)
... or paste a base64-encoding here
.8cc0fa3619/number_format.xlsm.b64
(it's a base64 encoded version of the file https://raw.githubusercontent.com/SheetJS/test_files/master/number_format.xlsm) and paste it in the boxIf you don't see output, there is an issue with the library. If you do see output, then we most likely have a problem with actually reading the binary data from the XHR. (I looked into IE8 XHR a little bit and it seems that we'll have to do something more clever to handle binary data. For example, http://miskun.com/javascript/internet-explorer-and-binary-files-data-access/ suggests a few approaches going through VBScript)
Just tried it, I do not see output.
I repeated the steps in Chrome and i did see an output.
Not sure if it means anything, but under Advanced Demo Options for IE8, Use Web Workers & Use readAsBinaryString check boxes are grayed out.
-Mike
@wintersm I can reproduce the issue using the IE8 compatibility mode in IE11. It sees all of the worksheet names but the worksheet objects themselves are empty :(
Bummer. Not sure I can be much help, but I am available if you need me to test anything.
@wintersm can you refresh and test again? The js-xls shim had a definition for
Array.isArray
but the corresponding entry was missing in the js-xlsx shimwow. very impressive. I compared Chrome and IE8 outputs and they are (nearly) identical.
Not sure if this was intentional, but as an example, under Accounting on SHEET 2011:
IE8:
,1,-1.2,12.3,-12.34,123.45,-123.456,1234.567,-1234.5678,12345.6789,-12345.67891Chrome:
, 1.00 , (1.20) , 12.30 , (12.34) , 123.45 , (123.46) ," 1,234.57 "," (1,234.57) "," 12,345.68 "," (12,345.68) "
@wintersm Can you check the ajax demo http://oss.sheetjs.com/js-xlsx/ajax.html again? I added a workaround using VBArray that appears to work in IE8 (tested in IE8 Document Mode from IE11)
As for the formatting, good catch! The culprit is sloppy string character extraction: https://github.com/SheetJS/ssf/blob/master/ssf.js#L566 -- using
str[n]
to access characters in a string is not supported everywhere.negative. Just a blank screen with
JS-XLSX AJAX Demo
at the top.
FYI, here is what I'm using:
And here is the error I get:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; chromeframe/32.0.1700.107; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E)
Timestamp: Tue, 22 Jul 2014 18:08:07 UTC
Message: VBArray expected
Line: 65
Char: 3
Code: 0
URI: http://oss.sheetjs.com/js-xlsx/ajax.html
Hey, just checking in to see if you have had any luck getting SheetJS to work with IE8. Please let me know if I can help test anything for you.
Thanks.
-Mike
@wintersm The recent push (check the gh-pages branch), based on http://stackoverflow.com/a/5913807, appear to work on IE6 and on IE8: http://oss.sheetjs.com/js-xlsx/ajax.html
There are some differences between the IE and chrome rendering, but for those I will track in a new issue
Hi,
i am using sheetjs to convert excel files to json using file upload. Its working fine in chrome and firefox but not in ie8. Could any one help me in fixing this issue?