We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Export to pdf and print

Hi, 

I'm using Syncfusion for asp.net web forms. I'd like to know whether we can export the chart control to pdf, excel and csv. Also, please let me know if print functionality can be implemented. If yes, could you provide me a sample project for the same?

Thanks and regards
Dhirender

5 Replies

JA Jayavigneshwaran Syncfusion Team January 19, 2015 11:23 AM UTC

Hi Dhirender,

Thanks for using Syncfusion product.

We have analyzed this. Currently chart can be exported as image only. And then printing the image can be done manually.

We have already logged task to export chart in excel format.

The below shows the step for saving the rendered chart as image.

From version 12.3.0.36 exporting is done without using any other libraries.

To export a chart, you have to render it in HTML5 canvas. This is done by setting the below option

[ASPX]

  <ej:Chart ID="Chart1" runat="server" EnableCanvasRendering="True"> 

        </ej:Chart>

And also the button/image to perform export should be place inside <a> anchor tag.

[HTML]

<a id="download" download="Chart.png" style="float: right; cursor: pointer;" >

   <img src="../images/chart/export.png" title="Export Chart"/>

</a>

We have made a sample to export the chart rendered for your reference.

Find it form the below link

 
Export_sample_ASP.zip

Sample is coded in Defalut.aspx page

 

The attached file contains export sample in both JS and ASP platforms.

The below code snippet shows the download method.

[JS]

function download() {

    var canvas = $("#Chart1").ejChart("exportChart");

    var dt = canvas.toDataURL();

    this.rel='nofollow' href = dt;

  }

Please let us know if you have any concern.

Thanks,

Jayavigneshwaran




SU sunil replied to Jayavigneshwaran February 24, 2015 06:32 AM UTC

Hi Dhirender,

Thanks for using Syncfusion product.

We have analyzed this. Currently chart can be exported as image only. And then printing the image can be done manually.

We have already logged task to export chart in excel format.

The below shows the step for saving the rendered chart as image.

From version 12.3.0.36 exporting is done without using any other libraries.

To export a chart, you have to render it in HTML5 canvas. This is done by setting the below option

[ASPX]

  <ej:Chart ID="Chart1" runat="server" EnableCanvasRendering="True"> 

        </ej:Chart>

And also the button/image to perform export should be place inside <a> anchor tag.

[HTML]

<a id="download" download="Chart.png" style="float: right; cursor: pointer;" >

   <img src="../images/chart/export.png" title="Export Chart"/>

</a>

We have made a sample to export the chart rendered for your reference.

Find it form the below link

 
Export_sample_ASP.zip

Sample is coded in Defalut.aspx page

 

The attached file contains export sample in both JS and ASP platforms.

The below code snippet shows the download method.

[JS]

function download() {

    var canvas = $("#Chart1").ejChart("exportChart");

    var dt = canvas.toDataURL();

    this.rel='nofollow' href = dt;

  }

Please let us know if you have any concern.

Thanks,

Jayavigneshwaran



Hello jayavigneshwaran,

How can i save this downloaded chart image in my local project folder. This code is working fine but the problem is it downloaded the image that I do not want to do. I want to save this chart image in my projects folder. Please help How to do that.



JA Jayavigneshwaran Syncfusion Team February 26, 2015 12:44 PM UTC

Hi Sunil,

Currently there is not support to achieve this. So a support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know if you have any concern.

Thanks,

Jayavigneshwaran




BO BotStatz November 22, 2019 11:24 AM UTC

what happens when we are not using ej:chart?
Is it possible to export to PDF?


BV Bhuvanesh Valarman Syncfusion Team November 25, 2019 11:35 AM UTC

Hi BotStatz,

Can you explain your requirement with more details, whether you want chart in PDF for the data without using the ej:chart.

Regards,
Gowri
  


Loader.
Live Chat Icon For mobile
Up arrow icon