https://issues.apache.org/bugzilla/show_bug.cgi?id=52658
Bug #: 52658
Summary: [PATCH] Merge cells of a table (rowspan and colspan)
Product: POI
Version: 3.8-dev
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: XSLF
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
I was trying to merge table's cell in a Powerpoint document and found nothing
in the API. Searching on the net, I only found out that it's was simply not
implemented.
http://apache-poi.1045710.n5.nabble.com/HSLF-merging-tablecells-possible-td2294865.html
I made a quick patch in the XSLFTableCell class to expose the 'gridSpan',
'rowSpan', 'hMerge' and 'vMerge' attributes of the "tc" element (the table cell
node in the OOXML schema) and added a method in the XSLFTable class to merge
the desired cells :
public void mergeCells(int firstRow, int lastRow, int firstCol, int lastCol);
In the client code :
XSLFTable table = newSlide.createTable();
...
XSLFTableRow row = table.addRow();
....
table.mergeCells(0, 1, 0, 1);
Note : You need the full OOXML-schemas jar file (16 MB) to make the
(Powerpoint) table work in POI. The lite version don't seem to work for me.
Due to project rush I only implemented what I need and didn't review side
effect s or alternative uses (exemple : merge all the cell in the table,
unmerge cells, etc ?)
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]