473,405 Members | 2,294 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,405 software developers and data experts.

Problem with Open Save dialog and excel

Hi,

I have an aspx page which generates an excel document and transfers it to
the browser as attachment. Normally, once the document is transferred the
open save dialog prompts to open or save the excel document. When I click
save I can save the excel document or when I click open it directly opens in
excel. This works fine for all but one machine.

On one machine however the dialog prompts to open or save the excel document
(e.g. myexcel.xls) but when I click save, the filename textbox contains the
name of the page (mypage.aspx) instead of the excel document. When I save
now the document, not the excel document but really the page's html is saved
on disk.

All machines are set up with

Windows 2000 SP2
Excel 9.0.3821 SR-1 (Excel 2000)
Internet Explorer 6.0.2800.1106CO

Can somebody help?

Kind regards,
Michael
Feb 15 '06 #1
6 2681
What is the other machines excel version?

"Michael Groeger" <go*********@web.de>, haber iletisinde şunları
yazdı:un**************@tk2msftngp13.phx.gbl...
Hi,

I have an aspx page which generates an excel document and transfers it to
the browser as attachment. Normally, once the document is transferred the
open save dialog prompts to open or save the excel document. When I click
save I can save the excel document or when I click open it directly opens
in
excel. This works fine for all but one machine.

On one machine however the dialog prompts to open or save the excel
document
(e.g. myexcel.xls) but when I click save, the filename textbox contains
the
name of the page (mypage.aspx) instead of the excel document. When I save
now the document, not the excel document but really the page's html is
saved
on disk.

All machines are set up with

Windows 2000 SP2
Excel 9.0.3821 SR-1 (Excel 2000)
Internet Explorer 6.0.2800.1106CO

Can somebody help?

Kind regards,
Michael

Feb 15 '06 #2
They are all the same as stated below.

"Alper OZGUR" <al******@gmail.com> schrieb im Newsbeitrag
news:OF**************@TK2MSFTNGP10.phx.gbl...
What is the other machines excel version?

"Michael Groeger" <go*********@web.de>, haber iletisinde şunları
yazdı:un**************@tk2msftngp13.phx.gbl...
Hi,

I have an aspx page which generates an excel document and transfers it to the browser as attachment. Normally, once the document is transferred the open save dialog prompts to open or save the excel document. When I click save I can save the excel document or when I click open it directly opens in
excel. This works fine for all but one machine.

On one machine however the dialog prompts to open or save the excel
document
(e.g. myexcel.xls) but when I click save, the filename textbox contains
the
name of the page (mypage.aspx) instead of the excel document. When I save now the document, not the excel document but really the page's html is
saved
on disk.

All machines are set up with

Windows 2000 SP2
Excel 9.0.3821 SR-1 (Excel 2000)
Internet Explorer 6.0.2800.1106CO

Can somebody help?

Kind regards,
Michael


Feb 15 '06 #3
I had the same problem and changed the code as belows. This had solved my
problem...

I hope it helps...

Response.Clear()

Response.Charset = ""

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

Dim stringWrite As New System.IO.StringWriter

Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite)

Dim dg As New DataGrid

dg.DataSource = dsExp.Tables(0) ' dsExp is the dataset

dg.DataBind()

dg.GridLines = GridLines.Both

dg.HeaderStyle.Font.Bold = True

dg.DataBind()

Dim Img As New System.Web.UI.WebControls.Image

Img.ImageUrl = "images/reportlogo.jpg"

Img.RenderControl(htmlWrite)

dg.RenderControl(htmlWrite)

Response.Write("<html><head><META HTTP-EQUIV=""Content-Type""
CONTENT=""text/html; charset=utf-8""></head><body>" & stringWrite.ToString &
"</html></body>")

Response.End()

"Michael Groeger" <go*********@web.de>, haber iletisinde şunları
yazdı:uT*************@TK2MSFTNGP11.phx.gbl...
They are all the same as stated below.

"Alper OZGUR" <al******@gmail.com> schrieb im Newsbeitrag
news:OF**************@TK2MSFTNGP10.phx.gbl...
What is the other machines excel version?

"Michael Groeger" <go*********@web.de>, haber iletisinde şunları
yazdı:un**************@tk2msftngp13.phx.gbl...
> Hi,
>
> I have an aspx page which generates an excel document and transfers it to > the browser as attachment. Normally, once the document is transferred the > open save dialog prompts to open or save the excel document. When I click > save I can save the excel document or when I click open it directly opens > in
> excel. This works fine for all but one machine.
>
> On one machine however the dialog prompts to open or save the excel
> document
> (e.g. myexcel.xls) but when I click save, the filename textbox contains
> the
> name of the page (mypage.aspx) instead of the excel document. When I save > now the document, not the excel document but really the page's html is
> saved
> on disk.
>
> All machines are set up with
>
> Windows 2000 SP2
> Excel 9.0.3821 SR-1 (Excel 2000)
> Internet Explorer 6.0.2800.1106CO
>
> Can somebody help?
>
> Kind regards,
> Michael
>
>



Feb 15 '06 #4
I suspect you're missing one of these key lines of code:
Response.Clear()

Response.ContentType = "application/ms-excel"

Response.AddHeader("Content-Disposition", _
"inline;filename=test.xls")

I've outlined all the necessary steps to do a proper Excel export here:
http://SteveOrr.net/articles/ExcelExport.aspx

--
I hope this helps,
Steve C. Orr
MCSD, MVP
http://SteveOrr.net

"Michael Groeger" wrote:
Hi,

I have an aspx page which generates an excel document and transfers it to
the browser as attachment. Normally, once the document is transferred the
open save dialog prompts to open or save the excel document. When I click
save I can save the excel document or when I click open it directly opens in
excel. This works fine for all but one machine.

On one machine however the dialog prompts to open or save the excel document
(e.g. myexcel.xls) but when I click save, the filename textbox contains the
name of the page (mypage.aspx) instead of the excel document. When I save
now the document, not the excel document but really the page's html is saved
on disk.

All machines are set up with

Windows 2000 SP2
Excel 9.0.3821 SR-1 (Excel 2000)
Internet Explorer 6.0.2800.1106CO

Can somebody help?

Kind regards,
Michael

Feb 15 '06 #5
Hi Steve,

the excel generation and the transfer to the client is done by a third party
tool (Aspose.Excel). I think the content - type is set to ms-excel, but i am
not quite sure. As the problem happens only on one machine I think it has
something to do with machine settings rather than with coding.

Regards,
Michael

"Steve C. Orr" <St***@Orr.net> schrieb im Newsbeitrag
news:84**********************************@microsof t.com...
I suspect you're missing one of these key lines of code:
Response.Clear()

Response.ContentType = "application/ms-excel"

Response.AddHeader("Content-Disposition", _
"inline;filename=test.xls")

I've outlined all the necessary steps to do a proper Excel export here:
http://SteveOrr.net/articles/ExcelExport.aspx

--
I hope this helps,
Steve C. Orr
MCSD, MVP
http://SteveOrr.net

"Michael Groeger" wrote:
Hi,

I have an aspx page which generates an excel document and transfers it to the browser as attachment. Normally, once the document is transferred the open save dialog prompts to open or save the excel document. When I click save I can save the excel document or when I click open it directly opens in excel. This works fine for all but one machine.

On one machine however the dialog prompts to open or save the excel document (e.g. myexcel.xls) but when I click save, the filename textbox contains the name of the page (mypage.aspx) instead of the excel document. When I save now the document, not the excel document but really the page's html is saved on disk.

All machines are set up with

Windows 2000 SP2
Excel 9.0.3821 SR-1 (Excel 2000)
Internet Explorer 6.0.2800.1106CO

Can somebody help?

Kind regards,
Michael

Feb 16 '06 #6
That's all done by a third party tool (Aspose.Excel) so I can't do that.
"Alper OZGUR" <al******@gmail.com> schrieb im Newsbeitrag
news:ew**************@TK2MSFTNGP15.phx.gbl...
I had the same problem and changed the code as belows. This had solved my
problem...

I hope it helps...

Response.Clear()

Response.Charset = ""

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

Dim stringWrite As New System.IO.StringWriter

Dim htmlWrite As New System.Web.UI.HtmlTextWriter(stringWrite)

Dim dg As New DataGrid

dg.DataSource = dsExp.Tables(0) ' dsExp is the dataset

dg.DataBind()

dg.GridLines = GridLines.Both

dg.HeaderStyle.Font.Bold = True

dg.DataBind()

Dim Img As New System.Web.UI.WebControls.Image

Img.ImageUrl = "images/reportlogo.jpg"

Img.RenderControl(htmlWrite)

dg.RenderControl(htmlWrite)

Response.Write("<html><head><META HTTP-EQUIV=""Content-Type""
CONTENT=""text/html; charset=utf-8""></head><body>" & stringWrite.ToString & "</html></body>")

Response.End()

"Michael Groeger" <go*********@web.de>, haber iletisinde şunları
yazdı:uT*************@TK2MSFTNGP11.phx.gbl...
They are all the same as stated below.

"Alper OZGUR" <al******@gmail.com> schrieb im Newsbeitrag
news:OF**************@TK2MSFTNGP10.phx.gbl...
What is the other machines excel version?

"Michael Groeger" <go*********@web.de>, haber iletisinde şunları
yazdı:un**************@tk2msftngp13.phx.gbl...
> Hi,
>
> I have an aspx page which generates an excel document and transfers it
to
> the browser as attachment. Normally, once the document is transferred

the
> open save dialog prompts to open or save the excel document. When I

click
> save I can save the excel document or when I click open it directly

opens
> in
> excel. This works fine for all but one machine.
>
> On one machine however the dialog prompts to open or save the excel
> document
> (e.g. myexcel.xls) but when I click save, the filename textbox

contains > the
> name of the page (mypage.aspx) instead of the excel document. When I

save
> now the document, not the excel document but really the page's html is > saved
> on disk.
>
> All machines are set up with
>
> Windows 2000 SP2
> Excel 9.0.3821 SR-1 (Excel 2000)
> Internet Explorer 6.0.2800.1106CO
>
> Can somebody help?
>
> Kind regards,
> Michael
>
>



Feb 16 '06 #7

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

Similar topics

0
by: eddie wang | last post by:
Excel open automatically without giving a dialog box option to Open/Save/Cancel using filesys.createTextFile. How to pop up the dialog box option to Open/Save/Cancel? Thanks.
4
by: John | last post by:
Hi, I generate a report in a comma delimited file and give it a name like MyReport.csv . I then set a Hyperlink control to point tp the file HyperLink1.text = "Download"...
0
by: Ramjee Tanguturi | last post by:
Hi, I face this peculiar problem. I have an export to excel functionality in my ASP.NET application. I set the Response.ContentType and Content Disposition properties of the page as ...
2
by: Steve Chatham | last post by:
I use the following code: Private Sub RbtnExport_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RbtnExport.SelectedIndexChanged Dim sFile As String =...
4
by: Dorte | last post by:
Hi, I am using the code below to stream a CSV file with the response object. Dim FileName As String = "Test.csv" With Web.HttpContext.Current.Response ...
1
by: Bon | last post by:
Hello all I create a form with three buttons in MS Access 2000. They are Open Excel Template, Save Draft and Save Final. When I click the Open Excel Template button, the Excel template will be...
0
by: Jonathan | last post by:
Hi everyone, I'm having an issue with my Excel streaming. I run my procedure and if I "Save As" when the dialog opens and then open the file I generate, it's perfect. Also, if I choose "Open" when...
0
by: chandan | last post by:
Hi, I have written an application for exporting grid data to excel using asp.net and c#.After writting the data in excel I save it in a folder inside my application.After that I invoke the file...
1
navanova
by: navanova | last post by:
Greetings, I have a problem of opening ms word and excel files on my computer. The files are there for a long time. I use to open and modify them. Suddenly, when i try to open the word files, a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.