Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 65567 invoked from network); 14 Apr 2003 17:38:39 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 14 Apr 2003 17:38:39 -0000 Received: (qmail 13554 invoked by uid 97); 14 Apr 2003 17:40:35 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 13547 invoked from network); 14 Apr 2003 17:40:35 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 14 Apr 2003 17:40:35 -0000 Received: (qmail 64108 invoked by uid 500); 14 Apr 2003 17:38:22 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 64097 invoked from network); 14 Apr 2003 17:38:22 -0000 Received: from web40709.mail.yahoo.com (66.218.78.166) by daedalus.apache.org with SMTP; 14 Apr 2003 17:38:22 -0000 Message-ID: <20030414173826.64208.qmail@web40709.mail.yahoo.com> Received: from [64.32.176.246] by web40709.mail.yahoo.com via HTTP; Mon, 14 Apr 2003 10:38:26 PDT Date: Mon, 14 Apr 2003 10:38:26 -0700 (PDT) From: Lior Shliechkorn Subject: Re: [OFF TOPIC] ServletOutputstream Issue To: Tomcat Users List In-Reply-To: <3E9AF00F.1010607@ptc.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1078974790-1050341906=:63800" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --0-1078974790-1050341906=:63800 Content-Type: text/plain; charset=us-ascii Yes, I have the header in place, and the utility creates a workbook, and then I use the WorkBook.write( outputstream). But for some reason it's not recognizing the excel data, and it's trying to open it up as the servlet name in excel and saying that the file cannot be opened. But when I try to generate the file to disk it works fine. Erik Price wrote: Lior Shliechkorn wrote: > Hi, I'm trying to use POI as a utility to generate a report in excel. The process to generate the report is as following (IIS5 & Tomcat 4.0.5): 1. JSP page with a form2. Servlet to pass the req, res to another servlet (appropriate report)3. Servlet (1. for HTML view and 2. for Excel view) I have no problems except when I try to get the file to be opened or saved on the client side it's trying to open/save the servlet at step 2. It's not prompting to save an xls file or open one, and I'm getting an error of site unavailable and the download fails. Any help would be great with this, since I'm obviously missing something about the outputstream. Again, thanks for taking the time to review my question, Lior How does your servlet serve the Excel file? I am assuming that you are using POI to write directly to the ServletOutputStream, obtained with response.getOutputStream()? If I am not mistaken you may need to set the content-type of the outgoing response: response.setContentType("application/vnd.ms-excel"); Erik --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --------------------------------- Do you Yahoo!? Yahoo! Tax Center - File online, calculators, forms, and more --0-1078974790-1050341906=:63800--