D
Dave
Okay, I have code here to export a datagrid to Excel. Can I modify it to
export it to a PDF? Thanks,
Function ExcelExport(ByVal DatagridID, ByVal ExportFilename)
Response.AddHeader("content-disposition", "attachment; filename=" &
ExportFilename & ".xls")
Response.ContentType = "application/vnd.ms-excel"
Me.EnableViewState = False
Response.Charset = String.Empty
Dim myTextWriter As New System.IO.StringWriter
Dim myHtmlTextWriter As New System.Web.UI.HtmlTextWriter(myTextWriter)
DatagridID.RenderControl(myHtmlTextWriter)
Response.Write(myTextWriter.ToString())
Response.End()
End Function
export it to a PDF? Thanks,
Function ExcelExport(ByVal DatagridID, ByVal ExportFilename)
Response.AddHeader("content-disposition", "attachment; filename=" &
ExportFilename & ".xls")
Response.ContentType = "application/vnd.ms-excel"
Me.EnableViewState = False
Response.Charset = String.Empty
Dim myTextWriter As New System.IO.StringWriter
Dim myHtmlTextWriter As New System.Web.UI.HtmlTextWriter(myTextWriter)
DatagridID.RenderControl(myHtmlTextWriter)
Response.Write(myTextWriter.ToString())
Response.End()
End Function