This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Export to Excel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Export to Excel" Watch "Export to Excel" New topic
Author

Export to Excel

Mangala Madasamy Erulappan
Greenhorn

Joined: Jul 08, 2008
Posts: 6
Hi,
I am new to JSF.
I have a requiement of exporting the list of records displayed in jsp page to excel sheet.
The data is stored in resulltrow .
I have written the following code to get the columns to a string array.


I dont know to proceed further.How to iterate over the array and display the data in excel sheet.
Please anybody help....
Ganesan Ramakrishnan
Ranch Hand

Joined: Mar 18, 2008
Posts: 88
Hi,
You can write the data to excel file using poi from apache.

poi

this is the open source jar for writing into excel file.

Regards
Ganesan
Mangala Madasamy Erulappan
Greenhorn

Joined: Jul 08, 2008
Posts: 6
HI,
Thanks for the reply. But my project requires me to write in simple java without any external jars
Mangala Madasamy Erulappan
Greenhorn

Joined: Jul 08, 2008
Posts: 6
HI,
Thanks for the reply. But my project requires me to write in simple java without any external jars
Ganesan Ramakrishnan
Ranch Hand

Joined: Mar 18, 2008
Posts: 88
Ok. But the problem is when you write in excel file without using the external jar means its writing the all datas into single column. So you difficult to read it. Its showing like text file. So for better readability go for poi.


Regards
Ganesan
Mangala Madasamy Erulappan
Greenhorn

Joined: Jul 08, 2008
Posts: 6
It is actually writing table headers into excel sheet in seperate columns.
But my data is displayed in the form of resultrow.I want to know how to get each data from resultrow into string to export to excel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Export to Excel
 
Similar Threads
Using JDBC to insert into MS Excel file
Strange behavior of getrow(n) method of Sheet interface in jxl api
Export to excel in jsp
accessing excel file from java
Open excel in JSP