Solved

Writing struts jsp output to csv/xls

Posted on 2010-11-19
3
649 Views
Last Modified: 2013-11-24
I have a struts jsp page which shows up a table with some data. I would like to have a button like 'Write CSV' or 'Write excel' in the same page, to write the table content as csv/xls file in the client machine. Please help me with the idea and write logic(without javascript).
Thanks,
Ganesh.
0
Comment
Question by:ganeshaneesh
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
sam2912 earned 250 total points
Comment Utility
This type of operation cannot be done using JavaScript. It has to be done on the server-side, and the output file downloaded to client.
0
 

Author Comment

by:ganeshaneesh
Comment Utility
I understand, but I expect sample code.
-Aneesh.
0
 
LVL 14

Assisted Solution

by:sam2912
sam2912 earned 250 total points
Comment Utility
There are many libraries available which read/write CSV files. You can try these:
http://opencsv.sourceforge.net
http://sourceforge.net/projects/javacsv
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now