What would be the best method to determine the nested hierarchy? Would you be able to provide an example snippet for this task? Is it possible to parse from mergeDoc.MailMerge.GetFieldNames()? Is GetFieldNames() guaranteed to be ordered?
Thank you in advance for any help you can provide.
Thank you very much for your reply and that article. It is an article I’d read in the past I reviewed it again.
From my understanding the article deals with how to correctly create nested hierarchies in a word document and the basics of how to execute a merge with regions. We have many great working examples of these concepts in our current production code library. Made possible by this great article and others by your team.
However, what I’m hoping to do currently is apply logic at run time based on the observed nested merge table hierarchy that is present in an already correctly created word document. In other words I need to read an existing hierarchy in such a way that I can observe the parent child relationships for a merge with regions in the word document . Does that help clarify the questions above? Would this be something you’d be able to assist me with?
(I don’t think any existing materials cover this question based on my searching)
Hi Don,
Sorry for the confusion. You can use GetFieldNames method in this case. It will give the field names in the same hierarchy as they appear in the document structure.
Best Regards,
Might it be possible to get slightly more detailed answer? Maybe a staff member with some c# .Net experience would be able to address the original questions more thoroughly? Perhaps some basic example code?
Hi Don,
It would be great if you can attach a sample document and the expected output after running your desired code. This will help us prepare correct example. Sorry for the inconvenience.
Best Regards,
I realized that part of the problem is a lack of support for data hierarchies in .Net.
So I’d suggest this should be the best data structure to hold the output for a simple example
public struct Node {
String TableName;
List childern;
}
List TopLevelTables;
TopLevelTables[0] should have table name Order.
TopLevelTables[0].childern[0] should have table name Item.
TopLevelTables[0].childern[0].childern[0] should have table name Order.
TopLevelTables[1] should have table name Item.
See attached document. Thank you for looking at this for me. I hope this helps.
Hi Don,
A new feature request to support this feature has been logged into our issue tracking system as WORDSNET-12309. We will keep you updated on this issue in this thread.
Please also check the details about our new reporting engine at https://docs.aspose.com/words/net/linq-reporting-engine/.
It is to update you that we have added the MailMergeRegionInfo public class and the MailMerge.GetRegionsHierachy public method. These allow to obtain mail merge hierarchy including child regions and fields. Please see the following usecase for extracting full hierarchy of regions available in the document.