Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

POI HSLF trouble adding a table to a slide

866010Jun 1 2011
got the error when i was trying to execute the code below (slide.addShape(table); ), this is pretty much the example code that i got from
http://www.java2s.com/Open-Source/Java-Document/Collaboration/poi-3.0.2-beta2/org/apache/poi/hslf/examples/TableDemo.java.htm

i tried poi-scratchpad-3.5-beta3 and poi-scratchpad-3.1-final.jar, same error
can anyone please help? thank you

java.lang.ClassCastException: org.apache.poi.ddf.EscherSpRecord cannot be cast to org.apache.poi.ddf.EscherOptRecord
at org.apache.poi.hslf.model.Table.afterInsert(Table.java:119)
at org.apache.poi.hslf.model.Sheet.addShape(Sheet.java:250)



SlideShow ppt = new SlideShow();
Slide slide = ppt.createSlide();

Table table = new Table(1, 1);
TableCell cell = table.getCell(0, 0);
cell.setText("TEST");

slide.addShape(table); // line 119
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 29 2011
Added on Jun 1 2011
0 comments
426 views