How to do cellMerge based on Two Columns | LINQ Reporting using Java

Hi,

I am trying to implement cellMerge in a table using Linq reporting engine. While the cellMerge works, it does group by only based on the current column value. Is there any way to force cellMerge to consider the previous column value as well. I have give sample input and code for reference below. Kindly help me with this issue.

Input:
{ "Persons": [ { "Name": "Ram", "Description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum", "Id": 1, "Child": [ { "Name": "San", "Age": "10" }, { "Name": "Sanjeev", "Age": "10" } ] }, { "Name": "Raji", "Description": "Description 1", "Id": 2, "Child": [ { "Name": "Sanjeev", "Age": "10" } ] }, { "Name": "Anand", "Description": "Description 1", "Id": 3, "Child": [ { "Name": "Vishvaa", "Age": "10" }, { "Name": "Kishore", "Age": "10" } ] }, { "Name": "Sanjeev", "Description": "Description 1", "Id": 4, "Child": [ ] } ] }

Expected Output:
image.png (25.8 KB)

When I tried using CellMerge:
Template:
image.png (8.3 KB)

Output: (The second column got merged in the last two rows. We want this not to be merged as the first column value is different)
image.png (26.5 KB)

Then I tried using Nested Table:
Template:
image.png (9.8 KB)
Output: (The nested table height didn’t grow as the adjacent cell height and it looked odd)
image.png (25.5 KB)

Thanks.

Regards,
Ram.

@vinothsubramanian

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that generates the incorrect output .

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.

I have attached the requested details CellMerge Issue.zip (37.1 KB) in zip format.

The input data is: input-data.json & template.docx
The output file is: output.docx
I have given the expected output in the beginning of template.docx.
The console application source code is present in Program.cs

Kindly let me know if you need any more details.

Thanks for your help.

@vinothsubramanian

You are facing the expected behavior of Aspose.Words. We have logged your requirement as new feature WORDSNET-21823 in our issue tracking system. We will inform you via this forum thread once there is an update available on this issue. We apologize for your inconvenience.

@vinothsubramanian

The fix of feature WORDSNET-21823 will be available in the next version of Aspose.Words i.e. 21.5.

You need to use syntax <<cellMerge [p.IndexOf()]>><<[p.Description]>> in the second cell. Please use this syntax when Aspose.Words 21.5 is available. We will inform you via this forum thread once it is released.

The issues you have found earlier (filed as WORDSNET-21823) have been fixed in this Aspose.Words for .NET 21.5 update and this Aspose.Words for Java 21.5 update.