Problem with a merged table cell on imported HTML table

I have a document that has a field that contains an HTML table with borders. The table has 2 columns and multiple rows. The top row has both cells merged into one. When viewing the data in a web page before creating the word doc the table looks correct. The word doc however does not perform the merge correctly. The left cell is the same size it would be if not merged and the right cell does not display. The border outlines the top left cell so the table shows one outlined cell on the top row while the rest of the table has both rows outlined.

Instead of this with text in the top cell spanning both colums:

|------------------------------------|

|----------------|--------------------|

|----------------|--------------------|

|----------------|--------------------|

I see this with the text wrapped in the top left cell:

|----------------|

|----------------|--------------------|

|----------------|--------------------|

|----------------|--------------------|

I ran into this with another doument where I was placing mailmerge fields in a table and found that the field being merged would not merge correctly if there was no data in it. I had to place a character in the cell which apparently gets removed by the mege. I can't use that trick here because the html table is part of a data stream that I can't modify. I provided a document for you to check out. The top row should be one cell.

Please let me know how you make the attached document. Is it produced by Aspose.Words mail merge with HTML insertion? If so please provide the sample of an html that you are inserting and also the document as it is before mail merge. I need to reproduce the document creation process to be able to fix the problem.

Best regards,

Actually, I figured out what the problem is. I have a document that uses Mail Merge fields where the fields are inside a table. I use UpdateTableLayout make the HTML tables adjust properly to the cell they are placed in. It seems that UpdateTableLayout in this situation does not handle colspan correctly. The colums are not spanned and the contents of the first cell is wrapped to match the first cell size. I created a simple program and a word doc with table and merge field that should display the problem.

Hi,

Indeed, you seem to be correct. We will try to fix the behaviour of UpdateTableLayout shortly. Meanwhile, I have logged the issue as #1549.

any idea when i might get a fix for this? It’s been 10 days now.

We are planning to release a hotfix next week. Thank you for patience.

Hi,

Could you please tell us what version of Aspose.Words you use? Are you getting the same output with v4.2.1 (see attached)?

yes, the sample file was done with 4.2.1

Sorry for this delay, I will try to fix the error immediately; I just need to make sure where it is. From what I see in the sample document - there is no “column span” issue and the inserted table is similar to the HTML table shown by IE. Could you please specify where it is exactly?

I am not sure what you mean. If you use the sample program and template doc in the zip I submitted in this thread it should display the problem.

From what I can tell, if you have a table in Word and use InsertHTML to indert an HTML Table with spanned columns, the adjust causes the spanned cells in the HTML table to act as if they are not spanned and it actually loses the cell that should be part of the span. This is evident by the border following the sides of the cell with data and ignoring the fact the spanned cell is there.

I did use your program to generate the document; I'm attaching it again. I understand what problem you speak of, it is obvious in the very first attached document. But your program does not display the problem. Is it possible to attach the original template and code (to get a result similar to the very first document?).

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


This message was posted using Notification2Forum from Downloads module by aspose.notifier.