473,321 Members | 1,669 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

stream Excel to browser- Framework 2.0

I have a Framework 2.0 web site running on a Window 2003 server, We are
streaming an excel file(csv) into the browser for one of our customer
reports, When the excel browser window opens the data is in HTLM format, I
open the same file runnning a duplicate web site from my machine(XP) and the
data shows normally.

'Code that streams file to browser

Dim resp As HttpResponse
resp = Page.Response
resp.Clear()
resp.ContentType = "application/vnd.ms-excel"
resp.AppendHeader("Content-Disposition", "attachment;filename=" &
reportfilenamehere)
resp.WriteFile(reportfilenamehere)
resp.Flush()
resp.End()

Any Suggestion on how to solve this issue?

Thanks in Advance,
Rick
Oct 4 '07 #1
2 1565
I think it depends on a version of the browser.
I recall a KB on Microsoft about bug if you try to stream over https. So
make sure you doing it over http.

Also try to make sure your reportrfilename has appropriate extension .xls or
..csv
George.
"Rick" <rf*****@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>I have a Framework 2.0 web site running on a Window 2003 server, We are
streaming an excel file(csv) into the browser for one of our customer
reports, When the excel browser window opens the data is in HTLM format, I
open the same file runnning a duplicate web site from my machine(XP) and
the data shows normally.

'Code that streams file to browser

Dim resp As HttpResponse
resp = Page.Response
resp.Clear()
resp.ContentType = "application/vnd.ms-excel"
resp.AppendHeader("Content-Disposition", "attachment;filename=" &
reportfilenamehere)
resp.WriteFile(reportfilenamehere)
resp.Flush()
resp.End()

Any Suggestion on how to solve this issue?

Thanks in Advance,
Rick

Oct 4 '07 #2
On Oct 4, 6:50 pm, "Rick" <rfem...@newsgroups.nospamwrote:
reports, When the excel browser window opens the data is in HTLM format
You mean that Excel file is opened inside the browser window (but not
in HTML format)

Try to delete ContentType and see what happen

resp.ContentType = "application/vnd.ms-excel"

Oct 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Robert Oschler | last post by:
Hello, I have a web site that has an audio file on it that I make available for download. Right now I'm using the "right-click/save-as" approach. This is because left-clicking the link to the...
2
by: CVerma | last post by:
I'm using an html input control (System.web.UI.HTMLControls.HTMLInputFile) to upload files such as msword, excel, jpg, and pdf. I have the encType property set in the form:...
3
by: Don | last post by:
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...
1
by: Pedro Leite | last post by:
hello. got stalled at at point that i can no longer get my thoughts together. the point, is in classic asp, stream an excel file from a firebird database. temporarly save it if necessary...
1
by: Chris Lane | last post by:
Hi, I want to stream a comma separated string to the browser and have excel open up in the browser. How can I do this? This is not a file on disk, this is a string in memory. Thanks
1
by: axiarich | last post by:
We have some doc mgt "lite" on our site. I basically have a window with a button that opens the relevant document (Excel, PDF, etc.). The button calls some javascript which basically performs a...
0
by: Marc Scheuner | last post by:
Folks, we're trying to stream back a result set from a SQL query into Excel from our ASP.NET application. Basically, we're doing this here: Response.ContentType = "text/csv";...
1
by: Marc Scheuner | last post by:
Folks, we're trying to stream back a result set from a SQL query into Excel from our ASP.NET application. Basically, we're doing this here: Response.ContentType = "text/csv";...
6
by: Karl | last post by:
Hi all, It may seem like a rather odd request (or not) but I would like to be able to create a file (doc, jpg, xls or one of many other files that can be automated) on a website and stream it to...
1
by: mazdotnet | last post by:
Hi all, I'm trying to integrate a third party library that would parse an excel file and allows us to make changes to. Once I update the appropriate cells, I want to allow my users to download...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.