Unable to cast object of type 'iTextSharp.text.html.simpleparser.CellWrapper' to type 'iTextSharp.text.Paragraph'
<p>while converting gridview data to PDF im getting this error...pls help
Response.Cache.SetCacheability(HttpCacheability.NoCache);</p>

<pre><code>    StringWriter sw = new StringWriter();

    HtmlTextWriter hw = new HtmlTextWriter(sw);

    HtmlForm frm = new HtmlForm();

    gv.Parent.Controls.Add(frm);

    frm.Attributes["runat"] = "server";

    frm.Controls.Add(gv);

    frm.RenderControl(hw);

    StringReader sr = new StringReader(sw.ToString());

    Document pdfDoc = new Document(PageSize.A4, 30f, 30f, 30f, 0f);

    HTMLWorker htmlparser = new HTMLWorker(pdfDoc);

    PdfWriter.GetInstance(pdfDoc, Response.OutputStream);

    pdfDoc.Open();

    htmlparser.Parse(sr);

    pdfDoc.Close();

    Response.Write(pdfDoc);

    Response.End();
</code></pre>
