Export report file as xlsx or pdf on Flutter web app

2,861 views
Skip to first unread message

Adrian Rusin

unread,
Dec 5, 2019, 4:32:48 AM12/5/19
to Flutter Development (flutter-dev)
Hi Everyone!
I'm developing an admin panel by using latest Flutter SDK. So it's not required to use css or html. 
I've used only Flutter languages.

That's fine so far.
But I have a problem to export some reports as xlsx or pdf. It should be downloaded to client's computer.

Could you please help me to manage file create/edit/download?

Thanks
Adrian

Oleksii Shliama

unread,
Feb 14, 2020, 1:33:41 PM2/14/20
to Flutter Development (flutter-dev)
Hey Adrian,

The same situation here. Spent several hours searching and cannot find a thing. Have you found out the way to export files from flutter web app?

Terje A. Bergesen

unread,
Feb 14, 2020, 5:45:41 PM2/14/20
to Oleksii Shliama, Flutter Development (flutter-dev)
They should be generated on the server side, not from flutter. IMnsHO. 

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/9cc67b65-e8b4-43e5-b088-fbe6bc30427b%40googlegroups.com.
--
Terje A Bergesen - te...@bergesen.info
"Vae, puto deus fio" -- Vespasian, not his last words though

Oleksii Shliama

unread,
Feb 15, 2020, 11:13:31 AM2/15/20
to Flutter Development (flutter-dev)
I don't see why I should use the backend to generate simple configuration JSON file, dart code does it well enough.
Anyways, for anybody interested, I got 2 solutions working - check this SO https://stackoverflow.com/questions/59663377/how-to-save-and-download-text-file-in-flutter-web-application


On Saturday, February 15, 2020 at 12:45:41 AM UTC+2, Terje A. Bergesen wrote:
They should be generated on the server side, not from flutter. IMnsHO. 
fre. 14. feb. 2020 kl. 19:33 skrev Oleksii Shliama <o.sh...@gmail.com>:
Hey Adrian,

The same situation here. Spent several hours searching and cannot find a thing. Have you found out the way to export files from flutter web app?

On Thursday, December 5, 2019 at 11:32:48 AM UTC+2, Adrian Rusin wrote:
Hi Everyone!
I'm developing an admin panel by using latest Flutter SDK. So it's not required to use css or html. 
I've used only Flutter languages.

That's fine so far.
But I have a problem to export some reports as xlsx or pdf. It should be downloaded to client's computer.

Could you please help me to manage file create/edit/download?

Thanks
Adrian

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutt...@googlegroups.com.

Mahesh Pawar

unread,
Apr 2, 2020, 12:58:35 PM4/2/20
to Flutter Development (flutter-dev)
I have successfully exported CSV file using flutter web .. and XLSX file in flutter desktop. but still no luck with XLSX on flutter web

 String csv = const ListToCsvConverter().convert(rows);
String encodedFileContents = Uri.encodeComponent(csv);
print(encodedFileContents);
new html.AnchorElement(href: "data:text, $encodedFileContents")
..setAttribute("download", "report.csv")
..click();
Reply all
Reply to author
Forward
0 new messages