G
Guest
Hi, I am using the code below to export a webpage to Excel. The webpage has
three datagrids on it and they are all exported to Excel properly and
everything looks very nice, but we would really only like two of the three
datagrids to be exported. Is there a way to exclude certain sections of the
webpage from being exported to Excel? "DG" in the code here is one of the
datagrids on the page:
----------------------------------------------------
Dim resp As HttpResponse
resp = Page.Response
resp.ContentType = "application/download"
Page.EnableViewState = False
resp.Charset = String.Empty
resp.AppendHeader("Content-Disposition",
"attachment;filename=ContainerReport.xls")
Dim colHeaders As String
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
DG.RenderControl(hw)
three datagrids on it and they are all exported to Excel properly and
everything looks very nice, but we would really only like two of the three
datagrids to be exported. Is there a way to exclude certain sections of the
webpage from being exported to Excel? "DG" in the code here is one of the
datagrids on the page:
----------------------------------------------------
Dim resp As HttpResponse
resp = Page.Response
resp.ContentType = "application/download"
Page.EnableViewState = False
resp.Charset = String.Empty
resp.AppendHeader("Content-Disposition",
"attachment;filename=ContainerReport.xls")
Dim colHeaders As String
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
DG.RenderControl(hw)