so I have a web application that utilizes an export to excel function. this works well on all windows 7 machines and fails on windows xp machines.
the error reads:
"Internet Explorer cannot download webpage.aspx from site.net. Internet explorer was not able to open this internet site. The requested sie is either unavailable or cannot be found. Please try again later."
I have searched the web and not sure what this is.
here is my code:
If e.CommandName = "Export" Then
Response.Clear()
Response.AddHeader("Content-Disposition", "Attachment; FileName = FileName.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.ms-excel"
Response.Charset = ""
Me.EnableViewState = False
Dim tw As New System.IO.StringWriter()
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
Dim lb As LinkButton = New LinkButton
Dim m As Integer = 0
Dim frm As HtmlForm = New HtmlForm()
Me.Controls.Add(frm)
Dim gv As GridView = myGridview
gv.AllowPaging = False
Dim lastC As Int16 = GetColumnIndex(gv, "Comments")
gv.DataBind()
For x As Integer = 0 To gv.Rows.Count - 1
lb = gv.Rows(x).Controls(lastC).Controls(0)
Integer.TryParse(lb.Text, m)
If m > 0 Then
Dim strSQL As String = String.Format(SQL String)
Dim xds As DataSet = Execute Dataset
For j As Integer = 0 To xds.Tables(0).Rows.Count - 1
Me.GeeWee.Rows(x).Cells(lastC).HorizontalAlign = HorizontalAlign.Left
Me.GeeWee.Rows(x).Cells(lastC).Wrap = False
If j > 0 Then0
Me.myGridview.Rows(x).Cells(lastC).Text += vbTab
Me.myGridview.Rows(x).Cells(lastC).Text += xds.Tables(0).Rows(j).Item("Comments")
Else
Me.myGridview.Rows(x).Cells(lastC).Text = xds.Tables(0).Rows(j).Item("Comments")
End If
Next
xds.Dispose()
End If
Next
frm.Controls.Add(gv)
frm.RenderControl(hw)
Response.Write(tw.ToString())
Response.End()
frm.Dispose()
End If
gweedo
0 Points
5 Posts
Export to excel on Windows XP machine
Dec 28, 2012 06:13 PM|LINK
Hello,
so I have a web application that utilizes an export to excel function. this works well on all windows 7 machines and fails on windows xp machines.
the error reads:
"Internet Explorer cannot download webpage.aspx from site.net. Internet explorer was not able to open this internet site. The requested sie is either unavailable or cannot be found. Please try again later."
I have searched the web and not sure what this is.
here is my code:
If e.CommandName = "Export" Then Response.Clear() Response.AddHeader("Content-Disposition", "Attachment; FileName = FileName.xls") Response.Charset = "" Response.Cache.SetCacheability(HttpCacheability.NoCache) Response.ContentType = "application/vnd.ms-excel" Response.Charset = "" Me.EnableViewState = False Dim tw As New System.IO.StringWriter() Dim hw As New System.Web.UI.HtmlTextWriter(tw) Dim lb As LinkButton = New LinkButton Dim m As Integer = 0 Dim frm As HtmlForm = New HtmlForm() Me.Controls.Add(frm) Dim gv As GridView = myGridview gv.AllowPaging = False Dim lastC As Int16 = GetColumnIndex(gv, "Comments") gv.DataBind() For x As Integer = 0 To gv.Rows.Count - 1 lb = gv.Rows(x).Controls(lastC).Controls(0) Integer.TryParse(lb.Text, m) If m > 0 Then Dim strSQL As String = String.Format(SQL String) Dim xds As DataSet = Execute Dataset For j As Integer = 0 To xds.Tables(0).Rows.Count - 1 Me.GeeWee.Rows(x).Cells(lastC).HorizontalAlign = HorizontalAlign.Left Me.GeeWee.Rows(x).Cells(lastC).Wrap = False If j > 0 Then0 Me.myGridview.Rows(x).Cells(lastC).Text += vbTab Me.myGridview.Rows(x).Cells(lastC).Text += xds.Tables(0).Rows(j).Item("Comments") Else Me.myGridview.Rows(x).Cells(lastC).Text = xds.Tables(0).Rows(j).Item("Comments") End If Next xds.Dispose() End If Next frm.Controls.Add(gv) frm.RenderControl(hw) Response.Write(tw.ToString()) Response.End() frm.Dispose() End IfIt is being called from a gridview.
any ideas????
rossisdead2
Participant
1313 Points
300 Posts
Re: Export to excel on Windows XP machine
Dec 28, 2012 10:47 PM|LINK
What version of Internet Explorer?
Have you tried it in another browser?
Can the XP machine connect to any part of the site?
Are you running the site on the XP machine, or is it running on an external server?