Change Powerpoint chart data with .NET

Posted by mc6688 on Stack Overflow See other posts from Stack Overflow or by mc6688
Published on 2010-05-17T15:17:56Z Indexed on 2010/05/17 15:20 UTC
Read the original article Hit count: 273

Filed under:
|
|
|

I have a Powerpoint template that contains 1 slide and on that slide is a chart. I'd like to be able to manipulate that charts data using .NET.

So far I have code that...

  1. unzips the Powerpoint file.
  2. unzips the embedded excel file (ppt\embeddings\Microsoft_Office_Excel_Worksheet1.xlsx)
  3. It successfully manipulates the data in the excel sheet and zips it back up.
  4. Opens and manipulates ppt\charts\chart1.xml
  5. Powerpoint is then zipped up and delivered to the user

The result of this is a Powerpoint file that shows a blank chart. But when I click on the chart and go to edit data it updates the data and shows the correct chart.

I believe my problem is with the chart1.xml that I am generating. I have compared my generated version with a version created by Powerpoint and they are almost identical. The only differences are in the values for <c:crossAx> and <c:axId>.

There are also some rounding difference in the data. But I do not feel like that would result in an blank chart.

Is there another file that I need to edit? Does anyone have any ideas as to what else I should try to get this working?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about openxml