ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  can anyone help me
Posted by Priya on Mar-01-2012 15:48
Importing a webpage chart/graph to a word document in C#.net

  Re: can anyone help me
Posted by Peter Kwan on Mar-02-2012 01:59
Hi Priya,

To import a chart to a Word document, first create the chart as an image file in the hard disk. Then use MS Word to import that image file into the document.

To create a chart as an image file in the hard disk, the API is BaseChart.makeChart. For example:

c.makeChart("c:\\\\mychart.png");

If you are running in a web environment, please make sure your web server anonymous user account has read/write access to the directory that you want to save the chart image.

After creating the chart image, you may use MS Word to import the image to a Word document. You can do that programmatically using C# by using MS Word automation. You may refer to Microsoft documentation on how to use MS Word.

For your reference, there is some code fragment about how to import a chart to Excel in the following thread, using Excel automation in C#:

http://www.chartdir.com/forum/download_thread.php?bn=chartdir_support&thread=1246621500#N1246898530

Hope this can help.

Regards
Peter Kwan