Problem to merge cells in pptx

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Problem to merge cells in pptx

Diogo Luzzardi de Carvalho
Hi,

I'm trying to merge cells in pptx using the following code:

XSLFSlide slide = slideShow.createSlide();
XSLFTable table = slide.createTable(1, 4);
XSLFTableRow row = table.addRow();

List<TargetColumn> columns = Arrays.asList(TargetColumn.STATUS,
TargetColumn.DESCRIPTION);
for (TargetColumn column : TargetColumn.values()) {
     XSLFTableCell cell = row.addCell();
  if (columns.contains(column)) {
         cell.setText(column.name());
  }
  table.setColumnWidth(column.ordinal(), column.getColumnWidth());
}
row.setHeight(20);
table.setAnchor(new Rectangle2D.Double(30, 159, 119, 20));
table.mergeCells(0, 0, 1, 3);

TargetColumn.values is equals to 4;

So this seems to not be working for me. Could anyone tell me what I'm doing
wrong? I'm using the poi 3.15.

Best regards
Diogo

--
*Diogo Luzzardi de Carvalho*

*Systems Analyst and Java Developer*