temp temp wrote the following on 4/7/2006 1:59 PM:
I must create "export to excel spreadsheet" capability  for   my  pages .
  I will be having java.util.Collection  containing  search  results  which I 
have to convert into an excel sheet.What is the  best and simplest way to 
convert a Collection into excel spreadsheet .
  Thanks & Regards

Easiest is..

<%-- Set the content type header with the JSP directive --%>
<%@ page contentType="application/vnd.ms-excel" %>


<%-- Set the content disposition header --%>
<% response.setHeader("Content-Disposition", "attachment; filename=\"somefile.xls\""); %>

You also could try setting the header as...
<% response.setHeader("Pragma", "Public"); %>


If you want true Excel output, not just html displaying in Excel then you have to use something like POI or JExcelAPI http://jexcelapi.sourceforge.net/ (I happen to like JExcelAPI.. pretty easy to use also).

--
Rick
http://www.learntechnology.net

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to