المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to update a chart in a word 2007 document



C# Programming
07-10-2009, 05:51 PM
We have a asp.net application that generates a word 2007 document containing several charts.
I generated a template document and added the chart, just left the data empty.
Now I need to add the data from code.
I was not abble to do this, does anybody have a suggestion how to accomplish this?

In the maen time I tried a different approach, I generated an excel sheet from code with data and chart from an excel template.
After this is genetrated, I insert the chart into my word document.
Unfortunatly this does not work, chart remains empty in word document.

(2 blogs that describe the way I do this:
http://blogs.msdn.com/brian_jones/archive/2008/11/04/document-assembly-solution-for-spreadsheetml.aspx
http://blogs.msdn.com/brian_jones/archive/2009/03/13/importing-charts-from-spreadsheets-to-wordprocessing-documents.aspx)

It appears that I first need to manually open and save the excel sheet, when I do that and then try to insert the chart in the docx, it woks fine.
But this is not an option, since I doen't have Office installed on the server.

Please, someone point me in the right direction.