Vertical Table and MailMerge

Hi GemBox Team,

I’m running into an issue trying to create a “Horizontal Mail Merge” (adding columns dynamically instead of rows).

I know standard Mail Merge is designed to repeat rows, but I need to keep this logic inside the template without writing custom code to transpose the data.

The Workaround & The Bug To solve this, I used a workaround where I put the table inside a Text Box and rotated the Text Box 90 degrees. The idea is to let Mail Merge add “rows” normally, which visually render as columns because of the rotation. (I know this has pagination limits, but it works for my case).

This workaround actually works perfectly when I run the merge directly in MS Word. However, GemBox fails to process the merge fields inside that Text Box.

Since this works natively in Word, it seems like a bug or limitation in GemBox’s handling of Text Boxes.

Could you take a look? I’m hoping for a fix for the Text Box behavior, or if you have a native way to add columns dynamically via the template (without C# DOM manipulation), that would be even better.

Hi Kurtibu,

Please send us your template document so we can reproduce the issue and investigate it.

Regards,
Mario

Hi, I’m not sure how to upload it here so :

Hi,

The provided “Test.docx” doesn’t have a rotated TextBox.
Also, it doesn’t have any merge range defined, so I’m not sure how the “rows” should be added.

For testing purposes, I used the following, and I was able to get merge fields inside the TextBox to merge successfully:

var document = DocumentModel.Load("Test.docx");

document.MailMerge.Execute(
    new Dictionary<string, object>()
    {
        { "L_DimensionsLength", 1 },
        { "D_DimensionsLength", 2 },
        { "D_DimensionsLength.Unit", "cm" }
    });

document.Save("Test_Output.docx");

Can you send us a sample data source that you’re using so we can investigate your use case?

Regards,
Mario