本文整理了Java中org.apache.poi.xslf.usermodel.XSLFSlide.getRelationId()
方法的一些代码示例,展示了XSLFSlide.getRelationId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSLFSlide.getRelationId()
方法的具体详情如下:
包路径:org.apache.poi.xslf.usermodel.XSLFSlide
类名称:XSLFSlide
方法名:getRelationId
暂无
代码示例来源:origin: org.apache.poi/poi-ooxml
private void copyChart(CTGraphicalObjectData objData, XSLFGraphicFrame srcShape) {
XSLFSlide slide = (XSLFSlide) getSheet();
XSLFSheet src = srcShape.getSheet();
String xpath = "declare namespace c='http://schemas.openxmlformats.org/drawingml/2006/chart' c:chart";
XmlObject[] obj = objData.selectPath(xpath);
if (obj != null && obj.length == 1) {
XmlCursor c = obj[0].newCursor();
try {
// duplicate chart with embedded workbook
QName idQualifiedName = new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id");
String id = c.getAttributeText(idQualifiedName);
XSLFChart srcChart = (XSLFChart) src.getRelationById(id);
XSLFChart chartCopy = slide.getSlideShow().createChart(slide);
chartCopy.importContent(srcChart);
chartCopy.setWorkbook(srcChart.getWorkbook());
c.setAttributeText(idQualifiedName, slide.getRelationId(chartCopy));
} catch (InvalidFormatException e) {
throw new POIXMLException(e);
} catch (IOException e) {
throw new POIXMLException(e);
}
c.dispose();
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
private void copyChart(CTGraphicalObjectData objData, XSLFGraphicFrame srcShape) {
XSLFSlide slide = (XSLFSlide) getSheet();
XSLFSheet src = srcShape.getSheet();
String xpath = "declare namespace c='http://schemas.openxmlformats.org/drawingml/2006/chart' c:chart";
XmlObject[] obj = objData.selectPath(xpath);
if (obj != null && obj.length == 1) {
XmlCursor c = obj[0].newCursor();
try {
// duplicate chart with embedded workbook
QName idQualifiedName = new QName("http://schemas.openxmlformats.org/officeDocument/2006/relationships", "id");
String id = c.getAttributeText(idQualifiedName);
XSLFChart srcChart = (XSLFChart) src.getRelationById(id);
XSLFChart chartCopy = slide.getSlideShow().createChart(slide);
chartCopy.importContent(srcChart);
chartCopy.setWorkbook(srcChart.getWorkbook());
c.setAttributeText(idQualifiedName, slide.getRelationId(chartCopy));
} catch (InvalidFormatException e) {
throw new POIXMLException(e);
} catch (IOException e) {
throw new POIXMLException(e);
}
c.dispose();
}
}
内容来源于网络,如有侵权,请联系作者删除!