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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Export to pdf and print

Thread ID:

Created:

Updated:

Platform:

Replies:

117984 Jan 16,2015 11:59 AM UTC Feb 26,2015 12:44 PM UTC ASP.NET Web Forms 3
loading
Tags: Chart
Dhirender
Asked On January 16, 2015 11:59 AM UTC

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

Jayavigneshwaran [Syncfusion]
Replied On 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



sunil
Replied On 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.


Jayavigneshwaran [Syncfusion]
Replied On 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



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;