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

Free Support Forum - aspose.com

Inconsistent behaviour with dynamic columns and horizontal merge

Hello,
I’m creating a table with dynamic data in an existing word document.
In the word document I just create a placeholder table with 2 rows and 1 column like this:
[@@DATA@@]
[ Custom label ]
Then I replace the cell with “@@DATA@@” with many cells (horizontally in the same row).

Some times the table takes all page size (also if not requested), but I have already opened a bug for this in similar conditions (WORDSNET-20098).
Some times the second row (“Custom label” in the example above), becomes large as the whole table (like if it was merged), but not always and this makes the result unpredictable.

I’m having an inconsistent behaviour in different conditions.
Apparently simply changing these conditions, I get different results for the same operation:

  • Fixed cell width vs. auto cell width
  • Different text lenght in cells
  • Different cell width (for fixed cell width cases)

Moreover the inconsistence depends also on the way the output is produced:

  • DOCX or PDF
  • with or without calling UpdateTableLayout()

I tried to make a single word with all the different conditions (13 cases).
These are the strange behaviours I get:

  • case 4, 5: label cell is large as table in both DOCX and PDF, without UpdateTableLayout
  • case 4, 5: table takes all space in PDF, no DOCX, without UpdateTableLayout
  • case 6: label cell is large as table in both DOCX and PDF, without UpdateTableLayout
  • case 7, 8: last cell is larger in DOCX, no PDF, with UpdateTableLayout
  • case 10, 13: label cell is large as table in both DOCX and PDF, without UpdateTableLayout
  • case 10, 13: table takes all space , always

Note that there are different combinations, some are only in DOCX, some only in PDF, some in both, some with UpdateTableLayout(), some without UpdateTableLayout() and some in all conditions.

I don’t know what output is right and what is wrong, but I would expect to have the same behaviour in all conditions else I get different results applying the same C# logic to different word documents.

Tested with Aspose.Words 20.3 and Word 2013.
Bug Dynamic Columns.zip (115.1 KB)

See also this related bug report:

@agarberi,

We tested the scenarios and have managed to reproduce the same Inconsistent behavior on our end. For the sake of any correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-20127. We will further look into the details of this problem and will keep you updated on the status of linked issue. We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-20127) have been fixed in this Aspose.Words for .NET 22.3 update also available on NuGet.