Protected Sub btnReport_Click(sender As Object, e As EventArgs) Handles btnReport.Click Using sw As New StringWriter() Using hw As New HtmlTextWriter(sw) viewReport.RenderControl(hw) Dim sr As New StringReader(sw.ToString()) Dim pdfDoc As New Document(PageSize.A2, 10.0F, 10.0F, 100.0F, 0.0F) Dim htmlparser As New HTMLWorker(pdfDoc) PdfWriter.GetInstance(pdfDoc, Response.OutputStream) pdfDoc.Open() htmlparser.Parse(sr) pdfDoc.Close() Response.ContentType = "application\pdf" Response.AddHeader("content-disposition", "attachment;filename=profile.pdf") Response.Write(pdfDoc) Response.End() End Using End Using End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)