-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoding does not work on client #25
Comments
Did you try to load the file using server-side code ? |
Unfortunately, I use the web sdk. I cannot use server side code as I am not able to load dart.io lib on web. My dart version is 2.8.0. But have you tested it yourself on client side? Was that working in first place? |
The code is automatically tested with unitary test on server and on client (see test folder). To test on "server-side" code, you just have to create Dart program on your project.
|
But the Nevertheless, I need to be able to parse it using the Filereader from dart:html as in my code above but it seems that this fault not inserting the file correctly inside archive. I would be grateful if you can take a look and fix this one. BRs / Kostas |
My advice was to test your file without using web client, in other words, try your file using command-line code. |
Hello,
I am trying to parse an xlsx file on client right after selecting it on an input. I am following the steps suggested in readme file but it seems that the file is not loaded correctly into the archive.
My code:
void onFileUpload(Event event) { final List<File> files = (event.target as InputElement).files; final File file = files[0]; final FileReader reader = FileReader(); reader.onLoad.listen((_) { var decoder = SpreadsheetDecoder.decodeBytes(reader.result); var table = decoder.tables['Sheet1']; var values = table.rows[0]; print(values); }); reader.readAsArrayBuffer(file); }
Note that the above code works for images, so i am pretty sure that this part is OK. The exception that I get:
EXCEPTION: NoSuchMethodError: invalid member on null: 'decompress' STACKTRACE: package:spreadsheet_decoder/src/xlsx.dart 285:9 [_parseTable] package:spreadsheet_decoder/src/xlsx.dart 274:7 <fn> dart:sdk_internal 14797:11 forEach package:spreadsheet_decoder/src/xlsx.dart 273:30 [_parseContent] package:spreadsheet_decoder/src/xlsx.dart 110:5 new package:spreadsheet_decoder/src/spreadsheet.dart 38:14 _newSpreadsheetDecoder package:spreadsheet_decoder/src/spreadsheet.dart 76:12 decodeBytes
So, the problem is in xlsx.dart file, inside _parse table line 285,
var file = _archive.findFile("xl/$target");
does not find the file in the archive and returns null.BRs / Kostas
The text was updated successfully, but these errors were encountered: