1 Dec 2011 05:50
Updating Charts in a PPTX template
Kerwin <kerwin747 <at> gmail.com>
2011-12-01 04:50:45 GMT
2011-12-01 04:50:45 GMT
Hi All, I have a PPTX template with multiple charts as placeholders that need to be updated with data. I could not find documentation on how to update a given chart in a PPTX file directly. I have written some code below to be able to do this. Could you please let me know if this is the best way to update multiple charts in a PPTX file?. I essentially read the chart.xml and then read the related embedded Excel package. I am successful in reading the chart.xml but cannot read the embedded excel XML accurately as I could not find methods to differentiate the series and values using getsheetdata(). If I use XSSF I am able to update the excel but when I click on the sheet and return to the chart the additional series added is removed. Please suggest any better way to update the chart. Code: import java.io.FileInputStream; import java.io.FileOutputStream; import java.util.ArrayList; import java.util.List; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackagePartName; import org.apache.poi.openxml4j.opc.PackageRelationship; import org.apache.poi.xslf.usermodel.XMLSlideShow; import org.apache.poi.xssf.model.SharedStringsTable; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook;(Continue reading)
RSS Feed