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

copy paste functionality

Hello,

Users for my apps wish to use the charts that i create in their presentations. In the past I wrote functionality to enable a user to copy the chart with a previous control and then they can paste it in a program of their liking (Word/Powerpoint/mail).

How would i best achieve the same user experience using Essential Chart?

Thanks
Ron

9 Replies

SG Senthil Ganesh K Syncfusion Team January 19, 2010 02:53 PM UTC

Hi Ron,

Thanks for showing interest in Syncfusion products.

Below mentioned code is about the export of chart to word document:


exportFileName = fileName + ".doc";
file = fileName + ".gif";
if (!System.IO.File.Exists(file))
this.ChartWebControl1.SaveImage(Server.MapPath(file));
WordDocument document = new WordDocument();
IWSection section = document.AddSection();
IWParagraph paragraph = section.AddParagraph();
paragraph.AppendText("Essential Chart");
paragraph = section.AddParagraph();
paragraph.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Center;
paragraph.AppendPicture(System.Drawing.Image.FromFile(Server.MapPath(file)));
document.Save(Server.MapPath(exportFileName), Syncfusion.DocIO.FormatType.Doc );


Similarly we can export the chart to pdf,Xls etc.

Could you explain the term previous control in your update?
Please explain the functionality that you have used for copying the chart and paste it in liking applications(word,Powerpoint) and let me know about the platform(whether Asp.net or windows),language preferred and product version.
These information will help us to provide you the solution at the earliest.

Regards,
Senthil Ganesh K.


A a January 19, 2010 03:37 PM UTC

Thanks for the quick reply.

Before using Essential chart I used NPlot which is an opensource chart control. One of the methods in this control was CopyToClipboard which, who would have guessed, copied the control to the clipboard as a picture.

After this the user could paste from the clipboard in e.g. mail which could be notes or exchange.

i'm using winforms and vb.Net and just downloaded essential studio 7.403.0.20

once more...thanks,
Ron


SG Senthil Ganesh K Syncfusion Team January 20, 2010 05:51 PM UTC

Hi Ron,

Thanks for providing the information.

I have attached a sample in the below sample link.
Sample link:
http://help.syncfusion.com/support/Chart.Windows/F92510/main.htm

Step 1: Please run the sample.

Step 2:you can find the toolbar at the top.First click on the toolbar item 'Copychart'.

Step 3:After that click on the button'CopyClipboardImage'

Result:

The image of the chart will appear on the picturebox.

Then open the paint application and Use the shortcutkey for paste option(ctrl+v).

You can see the image of the chart is copied from the clipboard to the paint application.

Similarly, try this in mail application you are able to see the image copied from the clipboard.

Step 4: Stop the running sample.

Please let me know if this helps.

Regards,
Senthil Ganesh K.


A a February 2, 2010 03:05 PM UTC

Thanks Senthil Ganesh and sorry for the slow response. The link provided in your mail appears not to be working, at least not for me. Could you give me an update?

Thanks,
Ron


SG Senthil Ganesh K Syncfusion Team February 3, 2010 02:00 PM UTC

Hi Ron,

Sorry for the inconvenience caused.
Here is the working link of the sample.

Sample link:
http://help.syncfusion.com/support/Chart.Windows/F92510/main.htm

Please follow the steps mentioned in the last update and let me know if this helps.

Regards,
Senthil Ganesh K.


RV Ronnie van der Pluijm February 8, 2010 03:04 PM UTC

Thanks Senthil Ganesh, this is indeed the functionality that I am looking for.
Is there a certain method I can call if I want to do this without using the toolbar? I would like to be to use this functionality behind my own context menu. That would probably also prevent copying the toolbar to the clipboard.

Thanks,
Ron


SG Senthil Ganesh K Syncfusion Team February 9, 2010 12:11 PM UTC

Hi Ron,

Yes it is possible to achieve the same functionality using context menu.

I have attached a sample in the below link.

Sample link:
http://help.syncfusion.com/support/Chart.Windows/F92510/main1.htm

Step 1: Please run the attached sample.
Step 2: Right click on the chart. Context menu appears With two menu items "CopytoClipboard" and "Clear".
Step 3: Click on the "CopytoClipboard" menuitem and then click on the button(copyClipboardImage).
As a result the image will appear on the picture box.
Step 4: By clicking the "clear" menuitem the image get clear.

You can copy the image to the mail application and paint application from the clipboard.

Please let me know if this helps.

Regards,
Senthil Ganesh K.


A a February 9, 2010 02:30 PM UTC

This is exactly what i needed. Thanks for your support!


SG Senthil Ganesh K Syncfusion Team February 10, 2010 03:18 PM UTC

Thanks for the update.

Loader.
Live Chat Icon For mobile
Up arrow icon