poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Beeker <kiwiwi...@apache.org>
Subject Re: Create XSLF Table - What am I doing wrong?
Date Wed, 16 May 2018 20:00:07 GMT
On 5/15/18 4:20 PM, sai0276 wrote:
> I have the same problem.
>
> Did it get resolved by any chance.

Yes ... I haven't checked when, but I think it was something related to XmlBeans loading.

Just use POI 3.17 and the below code works.


> Can help me here.
I'm sure you can :)


Andi


try (XMLSlideShow slideshow = new XMLSlideShow(); FileOutputStream fos = new FileOutputStream("bla.pptx"))
{
    XSLFSlide slide = slideshow.createSlide(); XSLFTable newTable = slide.createTable(3, 3);
newTable.setAnchor(new Rectangle(100, 100, 100, 100)); XSLFTableRow tableRow = newTable.addRow();
XSLFTableCell cell = tableRow.addCell(); XSLFTextParagraph textparagraph = cell.addNewTextParagraph();
XSLFTextRun textrun = textparagraph.addNewTextRun(); textrun.setText("Any Text"); textrun.setFontColor(Color.BLUE);
textparagraph.setTextAlign(TextParagraph.TextAlign.CENTER); tableRow.addCell(); tableRow.addCell();
tableRow.mergeCells(0, 1); new DrawTableShape(newTable).setAllBorders(3., StrokeStyle.LineDash.LG_DASH_DOT,
Color.BLUE); slideshow.write(fos); }


Mime
View raw message