Posted on: 12/29/2014 10:05:07 AM | Views : 525

Hello,
I am using MS ACCESS database. I am trying to generate the PDF report from repetar and Gridview control. But there is no data in PDF. If bind the Data than getting Error "
The document has no pages.
Code :
Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=Panel.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); Panel1.RenderControl(hw); StringReader sr = new StringReader(sw.ToString()); Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 100f, 0f); HTMLWorker htmlparser = new HTMLWorker(pdfDoc); PdfWriter.GetInstance(pdfDoc, Response.OutputStream); pdfDoc.Open(); htmlparser.Pa ...

Go to the complete details ...