Sign in to follow this  
onkar

how to Export .aspx page containing fusion chart to pdf

Recommended Posts

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

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.
 
Hope this helps. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this