Problem with mergeCells

Hi,

this code throws a "Cell's can't be merged" exception. I appreciate your help on this issue.

Regards

Lars

Presentation pres = new Presentation();

Slide sld = pres.GetSlideByPosition(1);

Aspose.Slides.Table table= sld.Shapes.AddTable(10, 10, 1000, 1000, 4, 2);

// merge all cells in first row
table.MergeCells(table.GetCell(0, 0), table.GetCell(1, 0));
table.MergeCells(table.GetCell(0, 0), table.GetCell(2, 0));
table.MergeCells(table.GetCell(0, 0), table.GetCell(3, 0));

// merge first three cells in the second row
table.MergeCells(table.GetCell(0, 1), table.GetCell(1, 1));
// !!!! this throws an exception
table.MergeCells(table.GetCell(0, 1), table.GetCell(2, 1));

pres.Write("D:\\Copy\\perftest.ppt");

Hi Lars,

I have worked with the code snippet shared by you and have observed the issue as shared by you. An issue with ID 23481 has been created in our issue tracking system to further investigate and resolve the issue. For the time being, I have share the following code snippet with you and it works. In this code snippet, the cells are merged in reverse order as you are merging, Moreover, this thread has been linked with the issue, so that you may be automatically notified, once the issue is resolved.

Presentation pres = new Presentation();

Slide sld = pres.GetSlideByPosition(1);

Aspose.Slides.Table table = sld.Shapes.AddTable(10, 10, 1000, 1000, 4, 2);

// merge all cells in first row

table.MergeCells(table.GetCell(0, 0), table.GetCell(1, 0));

table.MergeCells(table.GetCell(0, 0), table.GetCell(2, 0));

table.MergeCells(table.GetCell(0, 0), table.GetCell(3, 0));

// merge first three cells in the second row

table.MergeCells(table.GetCell(1, 1), table.GetCell(2, 1));

table.MergeCells(table.GetCell(0, 1), table.GetCell(1, 1));

pres.Write("D:\\perftest.ppt");

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESNET-23481) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.