Return-Path: Delivered-To: apmail-jakarta-poi-user-archive@www.apache.org Received: (qmail 9118 invoked from network); 15 Feb 2005 15:20:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 15 Feb 2005 15:20:31 -0000 Received: (qmail 31337 invoked by uid 500); 15 Feb 2005 15:20:18 -0000 Delivered-To: apmail-jakarta-poi-user-archive@jakarta.apache.org Received: (qmail 31316 invoked by uid 500); 15 Feb 2005 15:20:18 -0000 Mailing-List: contact poi-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "POI Users List" Reply-To: "POI Users List" Delivered-To: mailing list poi-user@jakarta.apache.org Received: (qmail 31302 invoked by uid 99); 15 Feb 2005 15:20:18 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from smtp10.staples.com (HELO fracf2.staples.com) (66.181.92.62) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 15 Feb 2005 07:20:17 -0800 Received: from FRAEXIMS2.staples.com (Not Verified[10.1.7.82]) by fracf2.staples.com with NetIQ MailMarshal (v5.5.4.17) id ; Tue, 15 Feb 2005 10:20:14 -0500 Received: by fraexims2.staples.com with Internet Mail Service (5.5.2657.72) id ; Tue, 15 Feb 2005 10:20:14 -0500 Message-ID: From: "Sharma, Siddharth" To: POI Users List Subject: RE: Opening HSSF Workbook in Excel Date: Tue, 15 Feb 2005 10:20:10 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2657.72) Content-Type: text/plain X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N That is a fair comment. I am also vaguely aware of this behavior in IE. But I thought setting the content type explicitly overrode this behavior. Anyhow, as to using a servlet v/s a JSP, again comes down to container implementations. The request and response objects, even though should be the same classes, could be of different types in servlets and JSPs as long as they implement the HTTPServletRequest and HTTPServletResponse interfaces respectively. Maybe in your container, they are different implementations to support some vendor extension. (MAYBE!! Could easily be some other more trivial reason). As I said, your JSP worked fine when I ran it on my side (Websphere). -----Original Message----- From: Iain.Shepherd@barclayscapital.com [mailto:Iain.Shepherd@barclayscapital.com] Sent: Tuesday, February 15, 2005 9:54 AM To: poi-user@jakarta.apache.org Subject: RE: Opening HSSF Workbook in Excel (Totally off the top of my head) could your browser have been making dodgy guesses at the filetype? I know I had a situation (in ASP) where naming my script 'renderjpeg.aspx' didn't work - correct MIME type notwithstanding - but 'renderjpeg.jpg.aspx' worked fine. So maybe you could've tried naming the JSP '.xls.jsp...' What I experienced was documented dodgy behaviour in IE, though I don't have the link for it right now. -----Original Message----- From: Vytla, Aparna (GE Commercial Finance, NonGE) [mailto:aparna.vytla@ge.com] Sent: 15 February 2005 14:49 To: POI Users List Subject: RE: Opening HSSF Workbook in Excel Hey, Today i tried replacing my jsp with a servlet.It's working fine.Anyway,i don't see why it didn't work with the JSP. Thanks guys. -----Original Message----- From: Sharma, Siddharth [mailto:Siddharth.Sharma@Staples.com] Sent: Monday, February 14, 2005 5:04 PM To: POI Users List Subject: RE: Opening HSSF Workbook in Excel I copy-posted your code and ran it, it worked fine. Try setting the content length. Maybe your server is not setting the content length header, or something on those lines. -----Original Message----- From: Vytla, Aparna (GE Commercial Finance, NonGE) [mailto:aparna.vytla@ge.com] Sent: Monday, February 14, 2005 4:54 PM To: POI Users List Subject: RE: Opening HSSF Workbook in Excel Tried this too.Nope.Still the same problem. -----Original Message----- From: Sharma, Siddharth [mailto:Siddharth.Sharma@Staples.com] Sent: Monday, February 14, 2005 4:36 PM To: POI Users List Subject: RE: Opening HSSF Workbook in Excel Try doing this for all cells and see if this works. I am not sure if this will fix your problem though. But try it. cell1_New.setCellType(HSSFCell.CELL_TYPE_STRING); -----Original Message----- From: Vytla, Aparna (GE Commercial Finance, NonGE) [mailto:aparna.vytla@ge.com] Sent: Monday, February 14, 2005 4:28 PM To: POI Users List Subject: RE: Opening HSSF Workbook in Excel It seems it didn't refresh properly.Hence i saw some binary data showing up on the browser window.I tried closing the browser and opened a new instance. Now,it opens up an Excel but some junk is being shown inside the excel. thanks, -----Original Message----- From: Sharma, Siddharth [mailto:Siddharth.Sharma@Staples.com] Sent: Monday, February 14, 2005 4:18 PM To: POI Users List Subject: RE: Opening HSSF Workbook in Excel Could you explain what you mean by "It is showing the output on the browser itself."? -----Original Message----- From: Vytla, Aparna (GE Commercial Finance, NonGE) [mailto:aparna.vytla@ge.com] Sent: Monday, February 14, 2005 4:15 PM To: POI Users List Subject: RE: Opening HSSF Workbook in Excel Hi Siddharth, Thanks for your quick response.I've tried that too.It is showing the output on the browser itself.Here is my sample jsp page. <%@ page import = "java.util.*, java.text.*, javax.servlet.http.*,org.apache.poi.hssf.usermodel.*" %> <% response.setContentType("application/vnd.ms-excel"); HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet_New = wb.createSheet("New Contacts"); HSSFSheet sheet_Mod = wb.createSheet("Modified Contacts"); HSSFSheet sheet_Del = wb.createSheet("Deeleted Contacts"); HSSFRow header_New = sheet_New.createRow((short)0); HSSFRow header_Mod = sheet_Mod.createRow((short)0); HSSFRow header_Del = sheet_Del.createRow((short)0); HSSFCell cell1_New = header_New.createCell((short)0); HSSFCell cell2_New = header_New.createCell((short)1); HSSFCell cell3_New = header_New.createCell((short)2); HSSFCell cell4_New = header_New.createCell((short)3); cell1_New.setCellValue("First_Name"); cell2_New.setCellValue("Last_Name"); cell3_New.setCellValue("Middle_Name"); cell4_New.setCellValue("Suffix_Name"); HSSFCell cell1_Mod = header_Mod.createCell((short)0); HSSFCell cell2_Mod = header_Mod.createCell((short)1); HSSFCell cell3_Mod = header_Mod.createCell((short)2); HSSFCell cell4_Mod = header_Mod.createCell((short)3); cell1_Mod.setCellValue("Suffix"); cell2_Mod.setCellValue("Last_Name"); cell3_Mod.setCellValue("Middle_Name"); cell4_Mod.setCellValue("Suffix_Name"); HSSFCell cell1_Del = header_Del.createCell((short)0); HSSFCell cell2_Del = header_Del.createCell((short)1); HSSFCell cell3_Del = header_Del.createCell((short)2); HSSFCell cell4_Del = header_Del.createCell((short)3); cell1_Del.setCellValue("Deal_Name"); cell2_Del.setCellValue("PAM_Name"); cell3_Del.setCellValue("Middle_Name"); cell4_Del.setCellValue("Suffix_Name"); wb.write(response.getOutputStream()); %> Let me know if you have any other suggestions. thanks, -Aparna. -----Original Message----- From: Sharma, Siddharth [mailto:Siddharth.Sharma@Staples.com] Sent: Monday, February 14, 2005 4:03 PM To: POI Users List Subject: RE: Opening HSSF Workbook in Excel response.setContentType("application/vnd.ms-excel"); hssfWorkbook.write(response.getOutputStream); where response is an instance of HTTPServletResponse hssfWorkbook is the workbook you just created. An instance of HSSFWorkbook -----Original Message----- From: Vytla, Aparna (GE Commercial Finance, NonGE) [mailto:aparna.vytla@ge.com] Sent: Monday, February 14, 2005 3:59 PM To: poi-user@jakarta.apache.org Subject: Opening HSSF Workbook in Excel Hi Folks, I'd like to know if we can open a HSSF workbook in Excel without creating a physical file on the filesystem.I tried writing the workbook directly to the OutputStream of my JSP.But it doesn't work. Post me if you have turn around to this. Appreciate your response. regards, -Aparna. --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ ------------------------------------------------------------------------ For more information about Barclays Capital, please visit our web site at http://www.barcap.com. Internet communications are not secure and therefore the Barclays Group does not accept legal responsibility for the contents of this message. Although the Barclays Group operates anti-virus programmes, it does not accept responsibility for any damage whatsoever that is caused by viruses being passed. Any views or opinions presented are solely those of the author and do not necessarily represent those of the Barclays Group. Replies to this email may be monitored by the Barclays Group for operational or business reasons. ------------------------------------------------------------------------ --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/ --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/