serhio
serhio

Reputation: 28586

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 generate an image and include it in the document.

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

Upvotes: 2

Views: 4517

Answers (2)

Shahzad Latif
Shahzad Latif

Reputation: 1424

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.

Upvotes: 2

CodingWithSpike
CodingWithSpike

Reputation: 43698

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.

Upvotes: 4

Related Questions