uday12
04-11-2005, 03:11 PM
Could any body give suggestion to export my HTML results page in to Microsoft Excel sheet
Thanks
Thanks
|
Click to See Complete Forum and Search --> : How to export HTML page results in EXCEL sheet uday12 04-11-2005, 03:11 PM Could any body give suggestion to export my HTML results page in to Microsoft Excel sheet Thanks ray326 04-11-2005, 11:45 PM The easiest way is to take the results you're formatting (I assume in a table) on your JSP and stream it out from a servlet as tab-separated-values or comma-separated-values. uday12 04-12-2005, 04:08 PM The easiest way is to take the results you're formatting (I assume in a table) on your JSP and stream it out from a servlet as tab-separated-values or comma-separated-values. could you elborte some more Neeraj Garg 04-13-2005, 09:51 AM Hi, For exporting the HTML Data to Excel DataBase u can do two things. 1. either U can use third party some third party APIs which are freely available over the net or 2. instead of creating the .xls document create a .csv file which is nothing but a comma separated file. ray326 04-14-2005, 12:14 AM could you elborte some more Maybe. Right now your servlet does a database query and creates some object collection with the result. You then put that result into a bean, probably in the request, and forward to the JSP where you're displaying it. Instead of forwarding to that JSP for viewing you can forward to a JSP that sets it's content-type for comma separated values and use the body of the JSP to format up a csv stream instead of an HTML stream like a normal JSP would. You'll find another thread here where there's more discussion on that. difrad76 04-15-2005, 02:06 PM Use POI project. If you use it you can do whatever you want with Excel. You can find it at http://jakarta.apache.org/poi/ . BTW you are better off using actual servlet and not JSP. We had few problems with exports to excel from JSP. If you go with POI here is some pseudo code that you could use import org.apache.poi.hssf.usermodel.*; Do your thing create excel file then spit it out, like so. response.setContentType("application/vnd.ms-excel"); ServletOutputStream sos = response.getOutputStream(); wb.write(sos); sos.flush(); sos.close(); Hope this helps. Katya 05-12-2005, 09:32 AM Hello I got my servlet connected to Excel using POI HSSF,but I didnt find any function to get the cell value into the servlet after caluculating the formula in Excel.I am getting the values which are given for caluculating by using function cell.getstringcellvalue(),but I found no function to get the the formula value..... Please help me out soon please......... I am waiting for reply ..........please send me soon.... ray326 05-12-2005, 11:09 AM Is there not a cell.getCellFormula()? webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |