(Very Very Urgent) Getting Correpted table error while opening


#1

Hi,

I am using Aspose.Words evaluation version. I am importing a table from one template document and creating a new table and appending the cells of imported table. But i am getting correpted table error. Is it possible to apply the cell formats to another cell without using deep clone.

Thanks in advance.

Actually we are going to purchase this component ASAP.

Regards,

I.Prabhaharan.


#2

Thanks for considering our component.

Please mind that you should not append the same cell (or any node) to the document several times. If you are you will probably get the corrupted table.

CellFormat property is currently readonly. If you want to copy one CellFormat settings to another you need to assign them one by one.

I can help you further if you will attach or e-mail your test project.


#3

It appears that there is something in the destination document 'template.doc' that prevents normal import of the table. When I create destination document myself - the import goes fine. As a temporary workaround try to create your destination template anew.

I have logged this problem to our defect base as Issue #897. We will be able to deal with it in 2-3 weeks.


#4

We found there is a workaround for you. Just add an empty paragraph after the last table like shown in this code.

Document srcDoc = new Document(@"D:\897\TableTemplate.doc");

Document dstDoc = new Document(@"D:\897\Template.doc");

Table srcTable = srcDoc.Sections[0].Body.Tables[0];

for (int i = 0; i < 9; i++)

{

Table dstTable = (Table)dstDoc.ImportNode(srcTable, true);

dstDoc.Sections[0].Body.AppendChild(dstTable);

}

dstDoc.Sections[0].Body.AppendChild(new Paragraph(dstDoc));

dstDoc.Save(@"D:\897\Out.doc");

A proper fix to the issue will come out later.