Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exporting table data to a .csv file client side  RSS feed

 
shashikant nagavarapu
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,
I have a typical problem, for which I am looking for suggestions/advise.
The requirement is that I have to export data from a table(based on some search criteria) to a .csv file.. on the client side.

There would a export button on the jsp page clicking on which, the displayed data has to be saved on the client system.

Thanks in advance
Regards
Shashikant
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a forum specially for JSP questions, I'll move this over there.
 
Stefan Evans
Bartender
Posts: 1834
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually it would probably better be done in a servlet.

The easiest way would be to requery the data, and then just write it out as a CSV.
Set the response headers to prompt the user to save the file
 
shashikant nagavarapu
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.

I am using the same but as the file is not a static one, and data varies each time. I need to add data to the response and using the getWriter(). My problem with this is that the number of such records may be many and adding huge data to the response object may be resource intensive operation. Meanwhile simultaneous operations are alos supported.

It would be great, if there is any less intensive method for handling the situation.

Thanks in advance.

Regards
Shashikant
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!