Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

TreeView to pdf

$
0
0

Hi All,

I have created a web form that will display the Organisation Chart in Tree form. I have dynamically created Tree View control from code behind.Everything working fine.The problem is when I am exporting TreeView to pdf I am getting te following error

"0x800a139e - JavaScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed."

The source code is

UpdateProgress1.Visible =

false;

            ImgTopBanner.Visible =

false;

            Response.AddHeader(

"content-disposition","attachment;filename=TestPage.pdf");

            Response.Cache.SetCacheability(

HttpCacheability.NoCache);

           

StringWriter sw = newStringWriter();

           

HtmlTextWriter hw = newHtmlTextWriter(sw);

           

this.Page.RenderControl(hw);

           

//TrvPrint.RenderControl(hw);

           

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

           

Document pdfDoc = newDocument(PageSize.A4, 10f, 10f, 100f, 0f);

           

HTMLWorker htmlparser = newHTMLWorker(pdfDoc);

           

PdfWriter.GetInstance(pdfDoc, Response.OutputStream);

            pdfDoc.Open();

            htmlparser.Parse(sr);

            pdfDoc.Close();

            Response.Write(pdfDoc);

            Response.End();

Please help


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>