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

Free Support Forum - aspose.com

Problems when horizontally merging cells


I am currently evaluating if Aspose.Words can replace our current word generation.
I ran into the following problem that cells do not get merged correctly.
The following code produces the this output: http://puu.sh/a0mHC/dfba7d9e77.png

builder.CellFormat.HorizontalMerge = CellMerge.First;
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;
for (int i = 0; i < NumberOfColumns - 2; i++)
builder.CellFormat.HorizontalMerge = CellMerge.Previous;
builder.CellFormat.HorizontalMerge = CellMerge.None;
builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;

As you can see in the attachement there are only two columns when the cells are merged.
Now when commenting out the “builder.CellFormat.HorizontalMerge = CellMerge.Previous;” line, the result looks as expected: http://puu.sh/a0mIf/c01da1a14a.png

How can I merge the the first 8 columns so that the result look equivalent to the second screen shot?
Thanks for your help

Lukas Häfliger

Hi Lukas,

Thanks for your inquiry. In case you are using an older version of Aspose.Words, I would suggest you please upgrade to the latest version (v14.6.0) from here
and let us know how it goes on your side. If the problem still remains, please create a standalone/runnable simple application (for example a Console Application Project) that demonstrates the code you used to generate your output document. As soon as you get these pieces of information to us we’ll start our investigation into your issue.