Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Streaming XLS to the client - ignore previous thread

Reply
Thread Tools

Streaming XLS to the client - ignore previous thread

 
 
CJM
Guest
Posts: n/a
 
      05-17-2004
[Sorry - having a bad day! Ignore the previous thread]

I have a page which allows the user to open one of several spreadsheets by
streaming the XLS to the client.

On my development site, everything appears to work fine. On the live site,
it works fine for the vast majority of users, but not for my colleague & I.

When this page is called with the correct inputs, the standard
Open/Save/Cancel/More Info dialog should appear. In the dialog, it gives the
following details:

Filename: Gothenburg Sweden.xls
File type: Microsoft Excel Spreadsheet
From: Servername

Clicking on open, means that the file will be opened in the local copy of
Excel; this works for most people, except one colleague and myself. In our
case, after clicking on Open, we get the following error msg:

"Internet Explorer cannot open travel.asp?journey=1 from <servername>
Internet Explorer was not able to open this internet site. The requested
site is either unavailable or cannot be found. Please try again later."

Anybody got any ideas about this?

TIA

Chris

Code Snippet:

sFileDir = Application("XLSDir")

If Len(sJourney) then
Select Case sJourney
Case 1
sFileName = "Gothenburg Sweden.xls"
sFilePath = sFileDir & sFilename
Response.AddHeader "content-disposition","attachment; filename=" &
"Gothenburg Sweden.xls"
Case 2
sFileName = "Nyköping Sweden.xls"
sFilePath = sFileDir & sFilename
Response.AddHeader "content-disposition","attachment; filename=" &
"Nyköping Sweden.xls"
Case Else
Response.Redirect "travel.asp"
End Select

' Create your header information
Response.ContentType = "application/asp-unknown"

' Create and configure your object
Set oFStream = Server.CreateObject("ADODB.Stream")
oFStream.Open()
oFStream.Type = 1
oFStream.LoadFromFile(sFilePath)

' Stream it to the client
Response.BinaryWrite oFStream.Read()

' Cleanup
oFStream.Close
Set oFStream = Nothing

' force the end
Response.End
End If



 
Reply With Quote
 
 
 
 
[MSFT]
Guest
Posts: n/a
 
      05-18-2004
Hi Chris,

From your description, the problem only occur on two clients. If other user
browser to same web page, they will get correct result. Is this right?

Regarding the problem, can you open other ASP pages in the same
application. For example, some page return normal HTML code instead XLS?

I also notice you used "application/asp-unknown", you may change it to
"application/x-msexcel" to see if this will help. Here is a complete sample
to send XSL from ASP:

HOWTO: Use the ADODB.Stream Object to Send Binary Files to the Browser
through ASP
http://support.microsoft.com/default...;EN-US;Q276488

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
 
 
 
CJM
Guest
Posts: n/a
 
      05-18-2004

"[MSFT]" <> wrote in message
news:...
> Hi Chris,
>
> From your description, the problem only occur on two clients. If other

user
> browser to same web page, they will get correct result. Is this right?
>


As far as I know, only the two clients have this problem. In both cases, if
they try and access the development version of the application (which is on
my machine) they both work, but for the live version (on a Win2k3 server)
they dont.

> Regarding the problem, can you open other ASP pages in the same
> application. For example, some page return normal HTML code instead XLS?
>


The application has several other ASP pages which all work normally.

> I also notice you used "application/asp-unknown", you may change it to
> "application/x-msexcel" to see if this will help. Here is a complete

sample
> to send XSL from ASP:
>


I've changed this but it doesnt appear to have made a difference.

> HOWTO: Use the ADODB.Stream Object to Send Binary Files to the Browser
> through ASP
> http://support.microsoft.com/default...;EN-US;Q276488
>


I'll check this out..

Thanks


 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      05-19-2004
Hi Chris,

You may try to clear the two clients computer's internet temporary files to
see if this will help. Additionally, It is better to use local
administrator to test so that we can ensure IE have enough permission to
load the XSL file.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
CJM
Guest
Posts: n/a
 
      05-20-2004
Luke,

I've tried clearing the temporary files but this has made no difference.
This is a sustained problem, so I didnt think this would be the issue, but
at least it is crossed off the list.

As for permissions, both users are Domain Administrators so we have
sufficient rights.

Chris

"[MSFT]" <> wrote in message
news:...
> Hi Chris,
>
> You may try to clear the two clients computer's internet temporary files

to
> see if this will help. Additionally, It is better to use local
> administrator to test so that we can ensure IE have enough permission to
> load the XSL file.
>
> Luke
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>



 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      05-21-2004
Hi Chris,

You may take a look at following articles to see if they can address the
problem:

Internet Explorer Cannot Download Office Documents from an IIS Server When
Content Expiration Is Set to Expire Immediately
http://support.microsoft.com/default...;EN-US;Q317208

An Error Message Occurs If You Click "Save Target As" for a Link
http://support.microsoft.com/default...;EN-US;Q319032

Cannot open an Excel 2003 workbook by using Internet Explorer 6.0
http://support.microsoft.com/default...;EN-US;Q840386

PRB: Internet Explorer Is Unable to Open Office Documents from an SSL Web
Site
http://support.microsoft.com/default...;EN-US;Q316431


Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
CJM
Guest
Posts: n/a
 
      05-21-2004
I've contacted MS Support and they have sent me the patch mentioned in
Q840386, and it has worked a treat.

Thanks

Chris

"[MSFT]" <> wrote in message
news:...
> Hi Chris,
>
> You may take a look at following articles to see if they can address the
> problem:
>
> Cannot open an Excel 2003 workbook by using Internet Explorer 6.0
> http://support.microsoft.com/default...;EN-US;Q840386
>


> Luke
> Microsoft Online Support



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
stiff dicks stilesproject streaming media host streaming mediasolutions streaming media funduk Java 0 11-04-2008 12:35 PM
70-300 Book (ignore my previous post) =?Utf-8?B?Q2xlbWVudCBFZHdpbg==?= MCSD 0 02-20-2006 08:11 PM
Please ignore my previous post: Why my Java code is THAT slow than C++? Kevin Java 3 02-12-2006 04:39 PM
Streaming an XLS to the client CJM ASP General 1 05-18-2004 03:18 AM
Streaming an XLS to the client CJM ASP General 1 05-17-2004 11:52 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57