i tried using text frame instead of second place holder but it didn't help...it still gives the same error..
for ur reference.. giving u the entire function which create powerpoint slides
this function takes collection and iterates it and gives the output....
also sending u the new Presentation format...
private void createPowerPoint(Collection subItemColl, String forAllLevel) throws Exception
{
try
{
Slide slide0 = slides.get(0);
Slide cloneSlide = cloneTheSlide(slide0, indexSubItem);
indexSubItem++;
Placeholders pholders = cloneSlide.getPlaceholders();
TextHolder thSlideTitle = (TextHolder) pholders.get(0);
TextHolder th = (TextHolder) pholders.get(1);
//TextHolder thSlideProject = (TextHolder) pholders.get(2);
Shapes shapes = cloneSlide.getShapes();
System.out.println("****shapes.size()***"+shapes.size());
TextFrame tf = shapes.get(1).getTextFrame();
Paragraphs paras = tf.getParagraphs();
paras.clear();
//for the paragraph
Shapes shapesBase = slides.get(0).getShapes();
System.out.println("****shapes.size()***"+shapes.size());
TextFrame tfBase = shapesBase.get(1).getTextFrame();
Placeholders pholdersBase = slides.get(0).getPlaceholders();
//TextHolder thBase = (TextHolder) pholdersBase.get(1);
Paragraphs parasBase = tfBase.getParagraphs();
System.out.println("parasBase.size()::"+parasBase.size());
Iterator itrsubItemColl = subItemColl.iterator();
TableReportData data = new TableReportData();
int indexItem = 0;
String slideTempTitle = "";
Paragraph paragraph0 = null;
Paragraph paragraph1 = null;
Paragraph paragraph2 = null;
Paragraph paragraph3 = null;
while(itrsubItemColl.hasNext())
{
data = (TableReportData) itrsubItemColl.next();
Integer itemlevel1 = data.getProjectItemLevel1();
Integer itemlevel2 = data.getProjectItemLevel2();
Integer itemlevel3 = data.getProjectItemLevel3();
Integer itemlevel4 = data.getProjectItemLevel4();
int calLevel = ApplicationUtils.getTemplateItemLevel(itemlevel2,itemlevel3,itemlevel4);
String templateTitle = data.getProjectItemTitle();
String templateDesc = data.getProjectItemDesc();
if(data.getItemLabel() == null)
{
templateTitle = data.getProjectItemTitle();
}
else
{
templateTitle = data.getItemLabel();
}
/* if(templateDesc != null && !(templateDesc.trim().equals("")))
{
templateDesc = " - " + templateDesc;
}*/
if(ApplicationUtils.validateString(templateDesc))
{
templateDesc = " - " + templateDesc;
}
else
{
templateDesc = " ";
}
String titleDesc = templateTitle + templateDesc;
if(calLevel == 1)
{
paragraph0 = new Paragraph(parasBase.get(0));
slideTempTitle = templateTitle;
paras.add(indexItem,paragraph0);
paras.get(indexItem).getPortions().get(0).setText(titleDesc);
paras.get(indexItem).getPortions().get(0).setFontHeight((short)level1FontSize.shortValue());
}
else if(calLevel == 2)
{
paragraph1 = new Paragraph(parasBase.get(1));
paras.add(indexItem,paragraph1);
paras.get(indexItem).getPortions().get(0).setText(titleDesc);
paras.get(indexItem).getPortions().get(0).setFontHeight((short)level2FontSize.shortValue());
}
else if(calLevel == 3)
{
paragraph2 = new Paragraph(parasBase.get(2));
paras.add(indexItem,paragraph2);
paras.get(indexItem).getPortions().get(0).setText(titleDesc);
paras.get(indexItem).getPortions().get(0).setFontHeight((short)level3FontSize.shortValue());
}
else if(calLevel == 4)
{
paragraph3 = new Paragraph(parasBase.get(3));
paras.add(indexItem,paragraph3);
paras.get(indexItem).getPortions().get(0).setText(titleDesc);
paras.get(indexItem).getPortions().get(0).setFontHeight((short)level4FontSize.shortValue());
}
++indexItem;
}
//Shapes shapes = cloneSlide.getShapes();
if(forAllLevel != null && forAllLevel.equals("true"))
{
thSlideTitle.getParagraphs().get(0).getPortions().get(0).setText(slideTempTitle);
thSlideTitle.getParagraphs().get(0).getPortions().get(0).setFontHeight((short)level1FontSize.shortValue());
}
else
{
thSlideTitle.getParagraphs().get(0).getPortions().get(0).setText(projectName);
thSlideTitle.getParagraphs().get(0).getPortions().get(0).setFontHeight((short)level1FontSize.shortValue());
}
shapes.get(2).getTextFrame().getParagraphs().get(0).getPortions().get(0).setText(projectName);
shapes.get(3).getTextFrame().getParagraphs().get(0).getPortions().get(0).setText(projectDateStr);
//thSlideProject.getParagraphs().get(0).getPortions().get(0).setText("the "+projectName);
}
catch(Exception e)
{
logger.log(Logger.ERROR, "Exception in TableWordReportWriter.createPowerPoint :: " + e);
e.printStackTrace();
throw e;
}
}