开发者

Generate a chart in .NET and include it in a Word file

I generate a MS Word document with the .NET application. I use merge fields and stuff like this.

Now, I have some data that I should represent in a chart (string-double collection).

I need to include this chart into that Word document.

How should I proceed? I suppose I should gen开发者_Python百科erate an image and include it in the document.

Is there a way to generate charts(images) with a specific "skin" in .NET?


If you are already interacting with Word using their interop library (Microsoft.Office.Interop.Word) then I think you can directly use its charts too.

http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.chart.aspx

Graph.Chart interop in Word

I've done this with Excel in the past (set a bunch of data in a grid then chart it) but not in Word, so i don't have any example code, sorry.


Have you tried Aspose.Cells and Aspose.Words for .NET? You can create a chart and convert it to image using Aspose.Cells for .NET. You can also add the converted image to Word document using Aspose.Words for .NET. This doesn't require MS Office to be installed on the server. Please see if this might help in your scenario.

Disclosure: I work as developer evangelist at Aspose.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜