We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Merge cells text

Hi support,

When merging two table cells, the text from the cells that are different than the first cell, is lost. Thus, if I have cell1 with text "cell1" and the CellMerge property set to "FIRST", and another cell - cell2 with text "cell2" and the CellMerge property set to "PREVIOUS", and those cell are merged, the new cell that is formed contains only the text "cell1".

Is this a known issue ?
If so, what are the workarounds to achieve desired merge ?

Thank you,
Milan

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I created new issue # 5367 in our defect database.

As a workaround you can use the following code:

tab.FirstRow.Cells[0].CellFormat.HorizontalMerge = CellMerge.First;

//Move all content from next cell to praviouse

foreach (Node child in tab.FirstRow.Cells[1].ChildNodes)

{

tab.FirstRow.Cells[0].AppendChild(child);

}

tab.FirstRow.Cells[1].CellFormat.HorizontalMerge = CellMerge.Previous;

I hope this could help you.

Best regards.

Hi Alexey,

Any news regarding 5367 issue ? Will this be supported in a future release ?

Regards,
Milan

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Unfortunately the issue is still unresolved.

I think that workaround I suggested in my previous post could be acceptable to temporary resolve this problem.

Best regards.