To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.
I need to make a excel exporter for a table. I use a button to "Export" and this button generate the xsl file in a directory.
The problem is how download the file :(
Serve the file as a FileResource or, more conveniently, as a StreamResource. Then use a Link component to point to that resource, as is done here.
If you're a Pro Account subscriber, see article #230.
Thanks for your response Marko bat the problem is that i need to genereta de file when the user press the button an then automaticaly download the file. I can not do it in two step. Ej.
1) The user view the table2) The user press export button that generate the file3) The file is automaticaly downloaded
I can not use a Link because i dont have the file when the table is rendered.
Then you should use a StreamResource to generate the file dynamically by the Vaadin application.