'PDF Response.Clear() Response.Buffer = True Response.ContentType = "application/pdf" Response.AddHeader("content-disposition", "attachment;filename=gridTest.pdf") Response.Cache.SetCacheability(HttpCacheability.NoCache) Dim sw As New StringWriter() Dim hw As New HtmlTextWriter(sw) myGridview.AllowPaging = False Dim frm As New HtmlForm() myGridview.Parent.Controls.Add(frm) frm.Attributes("runat") = "server" frm.Controls.Add(myGridview) frm.RenderControl(hw) myGridview.DataBind() Dim sr As New StringReader(sw.ToString()) Dim pdfDoc As New iTextSharp.text.Document(PageSize.A4, 10.0F, 10.0F, 10.0F, 0.0F) Dim htmlparser As New HTMLWorker(pdfDoc) PdfWriter.GetInstance(pdfDoc, Response.OutputStream) pdfDoc.Open() htmlparser.Parse(sr) pdfDoc.Close() Response.Write(pdfDoc) Response.End()
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE