Suggestions on Exporting Table Data

What’s a reasonable way to export a table full of data such that the user can save it off?

I’m converting the contents of my table to JSON but I’m stuck getting it to a place where the user is able to save it locally.

Any help would be appreciated.

thanks

Edit:

I tried the method from this thread: http://vaadin.com/forum/-/message_boards/message/200534;jsessionid=70318CD2E13450D759F08FCD3945BAF9

And it worked the first time, using the literal String sample text. But now that I’ve wired it up to get the text from a String I populate with JSON it no longer works. It still puts the sample text into the file rather than the JSON. I’ve checked that the stream is built using the correct text and the sample text no longer exists so I’m not even sure where it’s being pulled from.

Edit:

As usual I eventually found the issue. Using the above code and setting the cache time a small value did the trick.