Binary Stream Excel Client Problem

D

Don

Response.ContentType() = "application/vnd.ms-excel"
Response.Charset = ""
Response.BinaryWrite(stream)

The code when executed causes the
client to open an excel document and
display the information.
Included in the stream is a clock hh:mm:ss that appears in the
content.


The issue is when I run the app a second time
the page comes up in excel but it is the same stuff from the earlier
page. Time does not change.

If I change the content type to text html the
client will display a new page with updated
time after each request.

Is the Excel Page cached somewhere on the client
How do I get around this?

Any help is appreciated.


Note 3 machies 2 XP Pro Excel 2002 sp3 Fail to display new sheet
upon request
1 Win 2k Excel 2000 sp3 Works ok will display
new time in a sheet
 
R

Remy

Do you send an Excel File? Or just a csv file in the stream? Not really
sure where to clock is set.

You could change the filename everytime, so it shouldn't cache it:

Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "attachment;Filename=" +
fileName);

Hope that helps anyway.
Remy Blaettler
 
J

Joerg Jooss

Hello Don,
Response.ContentType() = "application/vnd.ms-excel"
Response.Charset = ""
Response.BinaryWrite(stream)
The code when executed causes the
client to open an excel document and
display the information.
Included in the stream is a clock hh:mm:ss that appears in the
content.
The issue is when I run the app a second time
the page comes up in excel but it is the same stuff from the earlier
page. Time does not change.
If I change the content type to text html the
client will display a new page with updated
time after each request.
Is the Excel Page cached somewhere on the client

Probably yes.
How do I get around this?

Before streaming out the document, add

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Cheers,
 
D

Don

Well thank you both for you replies....

We are using SAS Addin for MS Office.
I have since found it interferes with the proper operation of
the stream in conjunction with IE and Excel.

When the first stream is received, it stores the received stream as a
file in the cache
Content.mso folder.

When the second request is made, the client just dishes out the same
file already in cache!

I have noticed the Excel task stays runnng
even if you close out IE. This is abnormal. Excel should close out if
you stream to the client and then exit out of IE.

I removed SAS AMO and the machine works as it should. Presents a new
page each time a new stream is requested. The Excel task closes like it
should after exiting IE,

Joerg I am using the Nocache option but that does not help.
I wonder if there is something different needed to control MSO cache?

Remy thanks for the info on new naming. I may use that!


Don.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top