Posted By:
anil_palat
Posted On:
Wednesday, February 19, 2003 11:42 PM
If you want to save the file to the hard disk first with a filename & then show the link to the browser, you can try the following
FileOutputStream fileOut = new FileOutputStream("workbook.xls");
//write your generated excel work book to the stream.
wb.write(fileOut);
fileOut.close();
If you dont want to store the excel file to the hard disk then filenaming is required. It will take your servlet name as default.In this case you can directly write the excel work book to the browser as follows :
ServletOutputStream sos=response.getOutputStream();
//write your generated excel work book to the stream.
wb.write(sos);
sos.close();
hope this would solve your problem.