justkawal / excel

Excel Library for Flutter and Dart - https://pub.dev/packages/excel
MIT License
416 stars 228 forks source link

Different results in different environments #130

Open ChinaPuffer opened 2 years ago

ChinaPuffer commented 2 years ago

When developing, using Chrome web, read a row will get the data like [Data(WangKun, 3, 6, nul),Data(WangKun, 3, 6, nul)], if use flutter build web and put the web site in a nginx server, read a row will get the data like [[minified:f2, minified:f2, minified:f2, minified:f2, minified:f2, minified:f2, minified:f2, minified:f2, minified:f2, minified:f2, minified:f2, null]] What's the matter?

nivla360 commented 2 years ago

I have the same issue, please any updates on this?

justkawal commented 1 year ago

Sorry for the trouble. Can you please confirm that are you having this trouble in latest version: excel: 2.0.1

justkawal commented 1 year ago

If you are still having trouble, please feel free to re-open the issue again.

Danjavia commented 1 year ago

The issue is still happening with excel: 2.0.1 version

[minified:ik, minified:ik, minified:ik, minified:ik, minified:ik, minified:ik, minified:ik, minified:ik]

This is how was mounted

Some Advise?


    try {
      FilePickerResult? _result = await FilePicker.platform.pickFiles(
        type: FileType.custom,
        allowedExtensions: widget.allowedExtensions ?? ['xlsx'],
        allowMultiple: false,
      );
      print('RESULT KEY');

      if (_result != null) {
        // File file = File(result.files.single.path);
        if (!mounted) return;
        var bytes = _result.files.single.bytes;
        var excel = Excel.decodeBytes(bytes!);
        for (var table in excel.tables.keys) {
          print(table); //sheet Name
          print(excel.tables[table]); //sheet Name
          print(excel.tables[table]?.maxCols);
          print(excel.tables[table]?.maxRows);
          for (var row in excel.tables[table]!.rows) {
            print("$row");
          }
        }
        // setState(() {
        //   _fileName = _result;
        // });
      } else {
        // User canceled the picker
        print('FAIL');
      }
    } catch (e) {
      print("Unsupported operation" + e.toString());
    }
  }
Danjavia commented 1 year ago

Some update here?

FauconSpartiate commented 1 year ago

@justkawal could help you on this when he finds the time...

ksh-b commented 8 months ago

This is present in version 4.0.0

I am not able to download the file. The console shows this line:

Another exception was thrown: Instance of 'minified:jd<void>'

points to main.dart.js:

return}if(typeof console=="object"&&typeof console.log!="undefined"){console.log(a)

UPDATE: I made two changes which solved the issue for me:

  1. used excel.delete instead of excel.rename (I was getting an error related to list not modifiable with .rename)
  2. used TextCellValue instead of IntCellValue. (IntCellValue complained of null value even if there was none).
tguizelini commented 4 months ago

Same thing here. Any news ?

Flutter 3.22.0 Excel: 4.0.3

Screenshot 2024-05-23 at 13 02 39