Hi Forum,
with Slides 5.2.0.0 & Cells 5.3.3.0, i load a PPTX-Template and want to edit the included (not embedded!) Chart. This works fine so far, but after changing the caption of the series (column-headers of the included data-table), i can´t edit the chart-data in excel anymore.
Normally, we open a PPTX with Powerpoint, right-click the Chart and select "edit data" (<- don´t know if this is true for english versions of Powerpoint - the menu-entry of my german version for this is "Daten bearbeiten..") and Excel starts up. But when doing this with my generated PPTX, nothing happens!
I think that our customers will miss this functionality of the created PPTX, but - more important - i fear that this problem is caused by a corrupted PPTX-File and we can get other problems in the future.
I made some investagations and found out :
- The problems occurs when:
- I write to a cell that is part of a chart-series (in my Template : Row 0, Column 1-4).
- I use a new Template. (Start PowerPoint, Select Insert/Chart, Save as "template.pptx")
- The problem does not occur when:
- I write "outside" the chart-series (in my Template : Row 0, Column > 4)
- I write to the category-captions (in my Template : Row 1-4, Column 0)
--
To reproduce the behaviour, i attached my PPTX-Template and made a little C# test-app. To "acivate" the problem, un-comment the first "cell.PutValue()".
using Aspose.Cells;
using Aspose.Slides;
using Aspose.Slides.Pptx;
using Aspose.Slides.Pptx.Charts;
PresentationEx
pres = new PresentationEx("template.pptx");
foreach (ShapeEx shape in pres.Slides[0].Shapes)
if (shape is ChartEx)
{
ChartEx
ch = (ChartEx)shape;
ChartDataEx
chd = ch.ChartData;
Workbook
wb = (Workbook)chd.Workbook;
Worksheet
ws = wb.Worksheets[0];
// write captions to the categories (rows)..
// this produces the problem..
//ws.Cells[0, 1].PutValue("Test (0/1)");
// this works..
ws.Cells[0, 4].PutValue("Test (0/4)");
// write captions to the series (columns)..
// this works..
ws.Cells[4, 0].PutValue("Test (4/0)");
ws.Cells[5, 0].PutValue("Test (5/0)");
}
}
pres.Save("outfile.pptx", Aspose.Slides.Export.SaveFormat.Pptx);
--
Thank you for any tip! :)
Dirk