https://issues.apache.org/bugzilla/show_bug.cgi?id=48042
Summary: Cannot save changes made to a chart
Product: POI
Version: 3.5-FINAL
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: critical
Priority: P2
Component: XSSF
AssignedTo: [email protected]
ReportedBy: [email protected]
Created an attachment (id=24408)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=24408)
Original file containing a simple barchart
I tried saving a change made to a chart of an Excel 2007 file
for(POIXMLDocumentPart poixmlpartSheet : xssfSheet.getRelations())
{
if(poixmlpartSheet.getPackageRelationship().getRelationshipType().equalsIgnoreCase("http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings")
== false)
{
if(poixmlpartSheet.getPackageRelationship().getRelationshipType().equalsIgnoreCase("http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing")
== true)
{
for(POIXMLDocumentPart poixmlpartDrawing :
poixmlpartSheet.getRelations())
{
if(poixmlpartDrawing.getPackageRelationship().getRelationshipType().equalsIgnoreCase("http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart")
== true)
{
ChartSpaceDocument docChartSpace =
ChartSpaceDocument.Factory.parse(poixmlpartDrawing.getPackagePart().getInputStream());
CTChartSpace xChartSpace =
docChartSpace.getChartSpace();
CTChart xChart = xChartSpace.getChart();
CTTitle xTitle = xChart.addNewTitle();
xTitle.addNewTx().addNewRich().addNewP().addNewR().setT("new title");
xChart.setTitle(xTitle);
XmlOptions oOptions = new XmlOptions();
docChartSpace.save(poixmlpartDrawing.getPackagePart().getOutputStream(),
oOptions);
}
}
}
}
}
The original file "Barchart.xlsx" did not have a title.
Is there a specific way to save changes to a chart?
Regards,
nk
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]