I am trying to build an organisation chart using following code:
Presentation pres = new Presentation();
// Access the presentation slide
ISlide slide = pres.getSlides().get_Item(0);
// Add Smart Art IShape
ISmartArt smart = slide.getShapes().addSmartArt(0, 0, 400, 400, SmartArtLayoutType.OrganizationChart);
ISmartArtNode parentNode = smart.getAllNodes().get_Item(0);
parentNode.getTextFrame().setText("H S Bhartia\nCCMD");
while (parentNode.getChildNodes().size() > 0) {
parentNode.getChildNodes().removeNode(0);
}
SmartArtNode chNode0_1 = (SmartArtNode) ((SmartArtNodeCollection) parentNode.getChildNodes()).addNodeByPosition(0);
chNode0_1.getTextFrame().setText("Raju Sunil Mistry\nChief Human Resources Officer");
SmartArtNode chNode1 = (SmartArtNode) ((SmartArtNodeCollection) chNode0_1.getChildNodes()).addNodeByPosition(0);
chNode1.getTextFrame().setText("Shivshant Kumar\nGeneral Manager - HRIS");
SmartArtNode chNode1_1 = (SmartArtNode) ((SmartArtNodeCollection) chNode1.getChildNodes()).addNodeByPosition(0);
chNode1_1.getTextFrame().setText("Krishan Kumar Singh\nSenior Manager - HRIS");
SmartArtNode chNode1_2 = (SmartArtNode) ((SmartArtNodeCollection) chNode1.getChildNodes()).addNodeByPosition(1);
chNode1_2.getTextFrame().setText("Mayank Sunny\nManager - HRIS");
SmartArtNode chNode2 = (SmartArtNode) ((SmartArtNodeCollection) chNode0_1.getChildNodes()).addNodeByPosition(1);
chNode2.getTextFrame().setText("Hreetesh Bhandari\nSenior Manager - HR");
SmartArtNode chNode3 = (SmartArtNode) ((SmartArtNodeCollection) chNode0_1.getChildNodes()).addNodeByPosition(2);
chNode3.getTextFrame().setText("Mukesh Singh Bhadauria\nAVP & Head - Compensation & Benefits");
SmartArtNode chNode4 = (SmartArtNode) ((SmartArtNodeCollection) chNode0_1.getChildNodes()).addNodeByPosition(3);
chNode4.getTextFrame().setText("Geo Jacob P.P.\nExecutive Assistant");
chNode4.setAssistant(true);
// Save Presentation
pres.save("C:\\Users\\userDefault\\Desktop\\example.pptx", SaveFormat.Pptx);
Creating this chart itself takes 30-40 seconds. I want to create large charts with 60-70+ nodes.
My company, Jubilant Life Sciences, is in the middle of a project in which we need to make an org chart according to the selected employee by accessing his parent-child nodes through a database table.
We are quite interested in purchasing the licenses of your ASPOSE Slides APIs, but we are stuck at the problem that I have mentioned above and it’s very critical.
Please suggest a solution to this problem.