Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Repost: output to xls works in firefox, not in IE

Reply
Thread Tools

Repost: output to xls works in firefox, not in IE

 
 
Ned Balzer
Guest
Posts: n/a
 
      12-13-2006
I have a puzzling problem. I am using some code I found in another
thread here to output the results of a gridview to excel. Here is the
subroutine:

Sub SendToExcel(ByVal Source As Object, ByVal E As EventArgs)
Dim gv As GridView =
Ctype(ColRep1Form.FindControl("xlsRep1GridView"),
GridView)
If gv.Rows.Count.ToString + 1 < 65536 Then
gv.AllowPaging = False
gv.AllowSorting = False
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Response.Clear()
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader("content-disposition",
"attachment;filename=dept1.xls")
Response.Charset = ""
EnableViewState = False
gv.visible= true
gv.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
gv.DataBind()
End If
End Sub

This code works in firefox, or in IE when saving (not opening) the file
from the open/save dialogue. It doesn't work at all in IE when the
website is using https.(but it does work when using Firefox).

I would be grateful for any advice or explanation.

Thanks.

-- Ned

 
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
Using xtopdf, a PDF creation toolkit - Creating PDF Output from Plain Text, DBF, CSV, TDV, and XLS Data vasudevram Python 0 10-27-2006 06:07 PM
Can output as HTML but not as XLS Sonnich ASP General 0 07-31-2006 03:00 PM
When I turn on my PC, it works, works, works. Problem! Fogar Computer Information 1 01-17-2006 12:57 AM
output to *.xls SS C Programming 7 02-06-2004 04:44 PM
After rebooting my PC works, works, works! Antivirus problem? Adriano Computer Information 1 12-15-2003 05:30 AM



Advertisments