How can I set the column length to the content length

2003-07-21 Thread hotmail
Hi,everyone: How can I set the column length to the content length. I have used this method: String content = blah,blah,balh; int length = content.getBytes().lenght; sheet.setColumnWidth((short)1, (short)length*256); But, I think this is very boring. Is there a function, which I can call and it

Re: How can I set the column length to the content length

2003-07-21 Thread Andrew C. Oliver
If you don't care about the ties to AWT (has implications on mainframes and unix boxes), you can use the AWT FontMetrics class. It doesn't *exactly* match the Java versions of the fonts but you can probably get good enough for government work as the phrase goes. We have an RFE open on this:

IE loads Excel-Sheet twice

2003-07-21 Thread Christoph Jaeger
Hi, I apologize if this is a bit off topic, but I thought someone on this list may have experienced the same problems and found a solution already. I use POI to generate reports from a database. POI is used in a servlet, which serves the Excel sheet to a web-browser. Everything is fine for

Re: IE loads Excel-Sheet twice

2003-07-21 Thread Lior Shliechkorn
For some reason IE sends a request twice. It was something I ran into as well, however, I never ran into an issue where session variables were unaccessible. So I have no idea what that could be. Christoph Jaeger [EMAIL PROTECTED] wrote:Hi, I apologize if this is a bit off topic, but I thought

Re: IE loads Excel-Sheet twice

2003-07-21 Thread max . nam
I have indeed seen this behaviour - IE has some internal timeout which it reaches on longer operations and then 'cleverly' tries to get it again... However, there are no simple ways of solving it, i've personally done it in a completely async way (which might be a bit of an overkill), where

Damaged Excel sheet

2003-07-21 Thread Christoph Jaeger
Hi, While playing around (and trying to find the reason for my IE loads Excel sheet twice problem), I got the following error message when opening my POI generated Excel sheet: -- Microsoft Excel File Repair Log Errors were detected in file 'C:\Documents and Settings\Christoph Jaeger\Local

RE: IE loads Excel-Sheet twice

2003-07-21 Thread Christoph Jaeger
Thanks for your answer. I think your solution will work (I already thought about something similar, but hoped there would be some easier way out), but as you said, it's a bit of an overkill. But in the end, I will need it to work and spend the time to implement this. One more reason for loving MS

#VALUE! Error from setCellFormula(PPMT($C$7/1200, C11, $C$6, $C$5));

2003-07-21 Thread Jai W. Kang
Hello, I am new to the POI. It looks very promising, and especially I'm interested in using the HSSF to generate Excel files from Java program. One problem I have right now is as follows: Below is a part of my source codes to write formulas (PMT PPMT) using the setCellFormula. It works

Re: Excel File Download using JSP

2003-07-21 Thread Danny Mui
I don't see where the output is written to the servlet stream so excel is not receiving the file poi created. wb.write(response.getOutputStream()); would probably give you what you're looking for. Andrew Riggin wrote: I searched through the entire mailing list looking for an answer to my

Re: Excel File Download using JSP

2003-07-21 Thread Andrew Riggin
Dan, Your code worked!! Thank you. Andrew From: Danny Mui [EMAIL PROTECTED] Reply-To: POI Users List [EMAIL PROTECTED] To: POI Users List [EMAIL PROTECTED] Subject: Re: Excel File Download using JSP Date: Mon, 21 Jul 2003 15:14:29 -0400 I don't see where the output is written to the servlet

Re: Excel File Download using JSP

2003-07-21 Thread Danny Mui
Oh, I also plan to add this to the FAQ sometime soon. If you hit open it will fail in IE. Put a, response.reset() somewhere before you write it out and that will be fixed. Andrew Riggin wrote: Dan, Your code worked!! Thank you. Andrew From: Danny Mui [EMAIL PROTECTED] Reply-To: POI

Re: Excel File Download using JSP

2003-07-21 Thread Andrew C. Oliver
I think we should move the FAQ all onto the wikiThen you wouldn't have to plan. On 7/21/03 4:38 PM, Danny Mui [EMAIL PROTECTED] wrote: Oh, I also plan to add this to the FAQ sometime soon. If you hit open it will fail in IE. Put a, response.reset() somewhere before you write it out and

RE: IE loads Excel-Sheet twice

2003-07-21 Thread Michael Zalewski
You are mis-interpreting the reason for the double download. It has nothing to do with a timeout. The first download is from IE, which examines the header of the file to determine that the file really contains an Excel spreadsheet. The second download is from Excel itself, which may be embedded

Re: Excel File Download using JSP

2003-07-21 Thread Tetsuya Kitahata
-1 I won't translate the wiki page FAQ. Sincerely, -- Tetsuya ([EMAIL PROTECTED]) -- AIM# tkitahata - On Mon, 21 Jul 2003 22:45:44 -0400 (Subject: Re: Excel File Download using JSP) Andrew C. Oliver [EMAIL PROTECTED] wrote: