onkar Report post Posted August 18, 2014 My .aspx page contains fusion chart with grid view control. I want to export whole page with graph as it is to pdf. I used Following code but it does not show fusion chart in pdf instead it shows javascript code for fusion chart . void createPDF() { Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); this.Page.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.Parse(sr); pdfDoc.Close(); Response.Write(pdfDoc); Response.End(); } Share this post Link to post Share on other sites
Sanjukta Report post Posted August 18, 2014 My .aspx page contains fusion chart with grid view control. I want to export whole page with graph as it is to pdf. I used Following code but it does not show fusion chart in pdf instead it shows javascript code for fusion chart . void createPDF() { Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment;filename=TestPage.pdf"); Response.Cache.SetCacheability(HttpCacheability.NoCache); StringWriter sw = new StringWriter(); HtmlTextWriter hw = new HtmlTextWriter(sw); this.Page.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.Parse(sr); pdfDoc.Close(); Response.Write(pdfDoc); Response.End(); } Hi, Could you please let us know the FusionCharts version you are currently using? Please note that the latest version, i.e, FusionCharts v3.4 supports pure JavaScript version and hence, server-side export is only possible. But currently, the charts can only be exported using the hosted FusionCharts Suite XT Export handler service. We intend to ship a self-hosted Export Handler module next quarter. Ref.- http://docs.fusioncharts.com/tutorial-getting-started-adding-interactivity-exporting-to-images-or-pdf.html Hope this helps. Share this post Link to post Share on other sites