Export to CSV file...

114 views
Skip to first unread message

Asela Neligama

unread,
Sep 8, 2010, 5:40:37 AM9/8/10
to Google Web Toolkit
Hi all,

I need to export a list of objects (Eg. ArrayList of Strings) to a CSV
file.
After having a look at http://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html
it seems that java.io.FileWriter isn't supported by GWT.

Is there a way to accomplish my task?

Thanks in advance,
Asela.

ingo

unread,
Sep 8, 2010, 9:43:10 AM9/8/10
to Google Web Toolkit
hello asela,

i am doing the honeycrm project http://code.google.com/p/honeycrm/. to
import csv files, i let users insert the csv file content into a text
field. the client side code then parses the data and calls an import
rpc method to create the new entities on the server side (see
http://code.google.com/p/honeycrm/source/browse/branches/honeycrm_r134_gwt2.1m2/src/honeycrm/server/CommonServiceImpl.java#199).

to export data i would do it exactly the other way round - i would
request the data from the server, convert it into csv formatting on
the client side and write all data into a text field. i have no
experiences how good / bad this works with huge datasets.

i think you want to do the csv file creation completely on the server
side and then send a csv file back to the client. i saw people
creating HttpServlet classes for this purpose, see
http://markmail.org/message/jnr5eboc6r223xqp#query:+page:1+mid:wyztahkpkvllpr7l+state:results
i have never done something like that but i would expect that you
could send csv files to the browser like that.

hope that helps. i would appreciate it, if you could post your
progress because maybe i will have the same problem very soon.

kind regards,
ingo

On 8 Sep., 11:40, Asela Neligama <aselan...@gmail.com> wrote:
> Hi all,
>
> I need to export a list of objects (Eg. ArrayList of Strings) to a CSV
> file.
> After having a look athttp://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html

dolc...@gmail.com

unread,
Sep 8, 2010, 1:00:02 PM9/8/10
to Google Web Toolkit
Yeah, do it on the server and download it to the client side. Why
would you think everything in java.io is supported? (http://
code.google.com/webtoolkit/doc/latest/RefJreEmulation.html)

On Sep 8, 5:40 am, Asela Neligama <aselan...@gmail.com> wrote:
> Hi all,
>
> I need to export a list of objects (Eg. ArrayList of Strings) to a CSV
> file.
> After having a look athttp://code.google.com/webtoolkit/doc/latest/RefJreEmulation.html
Reply all
Reply to author
Forward
0 new messages