Missing Merge fields in a table

Hi,

I have a data entry form that is used to collect a person’s children, I made a table contains 15 cells, some cells will be filled from a data source while the other’s will be left empty to enable user to add more children. I repeated the same merge field for each cell, however Aspose.Word fills only some of them from the data source and the rest is ignored, for eaxmple if the DataTable contains 11 rows, only 5 are populated.

Dim HusbendOrWifeID As Integer = CType(stb.Rows(i)("PersonID"), Integer)
Dim tb As DataTable = GetFamily(HusbendOrWifeID)
Dim fDoc As Document = FamilyDoc.Clone()
fDoc.MailMerge.Execute(tb)
fDoc.MailMerge.DeleteFields()
AppendDoc2(Doc, fDoc)

Any hint to get rid of this is appreciated.

Thanks and Regards.


Hi,

Thank you for considering Aspose.

I guess in your case you should better use ExecuteWithRegions. Please read about this here:
https://docs.aspose.com/words/net/mail-merge-and-reporting/

No, this is not the solution, please see the attached from my previous post, we have one mail merge field which is repeated. The data comes correctly from the database but only few fields are merged, the others are ignored.

I apologize for the delay.

Thank you for the request, we’re looking into the issue.

I am very sorry for the delay once more.

  1. Let’s take a look at the table you have provided. It looks a bit complicated. Some cells contain 1 NEXT field before MERGEFIELD, some contain 2 NEXT fields before MERGEFIELD, some contain single MERGEFIELDs. Which ones should be filled from the data source - only single MERGEFIELDS, shouldn’t they?

  2. I have noticed two “types” of MERGEFIELDs in the template - ChPersonNameR and ChNationalId. What of them should be populated?

  3. Finally, would you be so kind to attach 2 things that could help us to understand what result you want to achieve. These are an approximate resulting document (how should it look like) and (what is probably more important) the structure of your data source, e.g. a small Access database. Then I could help you to rebuild your template as appropriate but at the moment I am still unsure what the Aspose.Word fault is.

Thank you for considering me!
Before I send you what you requested I will build the document template from scratch and try again. You gave me a good hint that some mergefields are identical to each other and some NEXT fields were inserted.

Thank you for your help.

I’m looking forward to the attachments. Glad to help you.

I refered again to the MailingLabels demo. I made a similar template for my application and it worked fine . Thank you for your help.