G
Guest
Hi,
Is there anything wrong with the code below in sending my browser page to
Excel? Before my page opens in Excel there's a message "Problems came up in
the following areas during load:" and it shows a CSS file in the "temporary
internet files" path. But when i click OK the page displays beautifully.
Even though my page has 3 datagrids, they all display with the same style as
seen in the browser page.
Though, the second problem is, when i try to export a datagrid which has
many rows, it will not export at all and a popup "unable to read file"
displays and Excel just shows gray blankness. Here is the code that i'm am
using:
Public Shared Sub ExportToExcel(ByVal argDG As DataGrid, ByVal argPage
As Page)
Dim resp As HttpResponse
resp = argPage.Response
resp.ContentType = "application/download"
resp.AppendHeader("Content-Disposition",
"attachment;filename=GLdata.xls")
Dim colHeaders As String
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
argDG.RenderControl(hw)
End Sub
Is there anything wrong with the code below in sending my browser page to
Excel? Before my page opens in Excel there's a message "Problems came up in
the following areas during load:" and it shows a CSS file in the "temporary
internet files" path. But when i click OK the page displays beautifully.
Even though my page has 3 datagrids, they all display with the same style as
seen in the browser page.
Though, the second problem is, when i try to export a datagrid which has
many rows, it will not export at all and a popup "unable to read file"
displays and Excel just shows gray blankness. Here is the code that i'm am
using:
Public Shared Sub ExportToExcel(ByVal argDG As DataGrid, ByVal argPage
As Page)
Dim resp As HttpResponse
resp = argPage.Response
resp.ContentType = "application/download"
resp.AppendHeader("Content-Disposition",
"attachment;filename=GLdata.xls")
Dim colHeaders As String
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
argDG.RenderControl(hw)
End Sub