Hi ,
I am trying to manipulate the chart data inside the embeded excel file of the pptx.
I was able to read and replace the excel file inside the PPTX but after saving the excel has the latest file with values but the chart is not getting rendered.
When I open the new saved file and click on edit data for chart then it shows the chart with new values.
Can some one shed some light and help.
Here is code snippet :
PresentationMLPackage pMLPackage =
(PresentationMLPackage)OpcPackage.load(new java.io.File(inputfilepath));
SlidePart slide = (SlidePart)pMLPackage.getParts().get(new PartName("/ppt/slides/slide1.xml") );
EmbeddedPackagePart embeded = new EmbeddedPackagePart(new PartName("/ppt/embeddings/Microsoft_Office_Excel_Worksheet1.xlsx"));
embeded.setBinaryData(getBytesFromFile(new File("C:/Sprint1-Templates/embeded.xlsx")));
pMLPackage.getParts().getParts().put(new PartName("/ppt/embeddings/Microsoft_Office_Excel_Worksheet1.xlsx"), embeded);
pMLPackage.save(new File("C:/Sprint1-Templates/pptx_chart_outsave.pptx"));
Thanks,
ik