Save Data as CSV File

2010-09-29 Thread Shelli Orton
I have a data table and would like the user to be able to save the data locally as a csv file when they click a link or button. The docs for DownloadLink state that it will generate a save as dialog which is exactly what I want, but, it appears to only work with a file that already exists. I

Re: Save Data as CSV File

2010-09-29 Thread Antoine Angenieux
You can use the constructor that takes an IModelFile and pass a LoadableDetachableModel or AbstractReadOnlyModel in which you generate your file. Don't Forget to call setDeleteAfterDowload(true) on your DownloadLink to avoid filling your drive too fast! I do that all the times and as usually

Re: Save Data as CSV File

2010-09-29 Thread Peter Karich
Hi, this worked for me: WebResource export = new WebResource() { @Override public IResourceStream getResourceStream() { return new StringResourceStream(getTweetsAsString(), text/plain); } @Override protected void setHeaders(WebResponse response) {