poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Zalewski <zalew...@optonline.net>
Subject RE: IE loads Excel-Sheet twice
Date Tue, 22 Jul 2003 02:54:01 GMT
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 inside IE or
launched in a separate window (it depends on registry settings).

You will not get the double download if you open directly in Excel. (Did you
know you can go into Excel, choose File | Open from the menu bar, and type
in a URL like
http://nagoya.apache.org/bugzilla/showattachment.cgi?attach_id=2551). In
this situation, the file gets downloaded only one time.

Here is something that I can't figure out. It should work from the command
line as well. (Open a command window and give the command

c:\Program Files\Microsoft Office\Office\Excel
"http://nagoya.apache.org/bugzilla/showattachment.cgi?attach_id=2551"

This should work but actually downloads an error page. Probably because
Excel actually asks for
"http://nagoya.apache.org/bugzilla/showattachment.cgi?attach_id=2551.xls"
which Bugzilla does not understand.

None of this trivia is really very important. But it may help you to
diagnose problems. One thing to consider - the first download may not
consume the entire output stream. IE closes the first download as soon as it
determines that the file is valid for Excel. Another thing - IE and Excel
will often ignore whatever you have set for mime type. It determines that
the file is Excel by examining the output stream header. And the last thing
to consider is that you may not always get a double download. For example, I
gave two methods of opening an .xls over the web (directly from Excel) and
neither will cause the double download.

-----Original Message-----
From: max.nam@jpmorgan.com [mailto:max.nam@jpmorgan.com]
Sent: Monday, July 21, 2003 11:03 AM
To: poi-user@jakarta.apache.org
Cc: liorshliech@yahoo.com
Subject: Re: IE loads Excel-Sheet twice


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 browser
polls the page for the export, which performs the export in a threaded
manner, and only attempts to return the big file once it's ready.

so, simplified:

1.
start exporting the file in a thread, get it's id and return that to the
browser with aim to refresh:
i.e
<meta http-equiv="Refresh" content
="15,url=my_export_generator.jsp?taskId=123">

2.
then in your jsp, just check if your thread's done (maybe saved its details
in some cache), if it is, simply return the content... if not.. go back to
step.1

- this way you give ie no chance of making you start the export twice,
(unless it takes a very long time to do step 1)

... hope that helps...






                      liorshliech@yahoo
                      .com                     To:
poi-user@jakarta.apache.org
                                               cc:
                      21/07/03 15:33           Subject:  Re: IE loads
Excel-Sheet twice
                      Please respond to
                      poi-user






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 <christoph.jaeger@dhl.com> wrote: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 small sheets (several hundred to a few thousand
rows). The result is just as expected. But when I try to do a bigger
query (say, 7000 rows) IE behaves strangely: first a request is sent to
the server to generate the Excel file. This file is downloaded (as it
seems), but when the next page comes up in IE, showing Excel, the Excel
program sends a second request to load the sheet. This time, the session
information (included in a cookie) is "forgotten", and so the query does
not work (does only work for logged in users, but without session
information I can not determine the user).

The same thing works without any problems on my Linux box using Galeon
as a web browser (and Gnumeric or Open Office to view the Excel sheet).

Has anyone on this list already experienced a similar problem?

Thanks a lot,

Best Regards,

Christoph J├Ąger


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org



---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!




This communication is for informational purposes only.  It is not intended
as
an offer or solicitation for the purchase or sale of any financial
instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.


---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: poi-user-help@jakarta.apache.org


Mime
View raw message