open sheet excel plataform Windows

Olá, fiz uma aplicação em flutter / Dart e usei a biblioteca  syncfusion_flutter_xlsio para gerar excel dos dados, nas plataformas de IOS esta funcionando, porem em Windows estou recebendo o erro abaixo, a planilha é gerada, porem não abre, fiz o teste das plataformas macos/android/ios e esta ok apenas Windows que tem esse erro.


WhatsApp Image 2022-07-25 at 18.10.14.jpeg


1 Reply

RS Ramya Sivakumar Syncfusion Team July 27, 2022 03:33 PM UTC

Hi Adenilson,


Greetings from Syncfusion.


We are unable to reproduce the issue at our end. The Excel file is generated and opened properly at our end. Please find the code snippet which we used at our end.


Code Snippet:

Future<void> _createExcel() async

{

    final Workbook workbook = Workbook();

    final Worksheet sheet = workbook.worksheets[0];

 

    // Set the text value.

    sheet.getRangeByName('A1').setText('Hello!!');

 

    final List<int> bytes = workbook.saveAsStream();

 

    final Directory directory = await getApplicationSupportDirectory();

    const String path =

        "D:\\Flutter\\Sample\\flutter_application-473825885\\flutter_application\\Output";

 

    final File file =

        File(Platform.isWindows ? '$path\\output.xlsx' : '$path\output.xlsx');

    await file.writeAsBytes(bytes, flush: true);

 

    if (Platform.isWindows) {

      await Process.run('start', <String>['$path\\output.xlsx'],

          runInShell: true);

    }

}


And kindly use the following commands to run the sample:


  • flutter build windows
  • flutter run -d windows


Regards,

Ramya.


Loader.
Up arrow icon