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

Free Support Forum - aspose.com



I have table with subtables. I want to use a command MailMerge.ExecuteWithRegions(dataSet);.

But this command make a problem in Subtables. I attach the template file and Xml file.

Are you have another way to do this?


private void BuildingTable_V2()


string[] strNameTable = new string[10];

int intmaxTables =0;

int strNameTableCount =0;

string[] strFieldNames;

strFieldNames = AsposeDocument.MailMerge.GetFieldNames();

DataSet dataSet = new DataSet();



for (int intFieldNames=0 ; intFieldNames< strFieldNames.Length ; intFieldNames++)


//Name of Tables

if (strFieldNames[intFieldNames].IndexOf("TableStart") ==0)


//Name of Table

string strHelp = strFieldNames[intFieldNames];

strNameTable[strNameTableCount] = strHelp.Substring(11);




intmaxTables = strNameTableCount;

for ( int intNameTable=0 ; intNameTable< intmaxTables ; intNameTable++)


string strNameTagOfTable =strNameTable[intNameTable];

DataTable myTable = new DataTable(strNameTagOfTable);

System.Xml.XmlNodeList nodeTableRows = XmlLetters.SelectNodes("//"+strNameTagOfTable);

if (nodeTableRows.Count >0)


System.Xml.XmlNodeList nodeTableCell = nodeTableRows.Item(0).ChildNodes;

for (int intnodelist = 0 ; intnodelist< nodeTableCell.Count;intnodelist++)


//Add columns to table

try //!!!*****




catch {} //!!!*****

// myTable.Columns.Add("Company");


for (int intnodeRow = 0 ; intnodeRow< nodeTableRows.Count;intnodeRow++)


nodeTableCell = nodeTableRows.Item(intnodeRow).ChildNodes;

DataRow row = myTable.NewRow();

for (int intnodelist = 0 ; intnodelist< nodeTableCell.Count;intnodelist++)


row[nodeTableCell.Item(intnodelist).Name] = nodeTableCell.Item(intnodelist).InnerText;

//row["Company"] = "Company" + i.ToString();

// myTable.Columns.Add("Company");




//Populate tables and add to the dataset.


}//if (nodeTableRows.Count >0)



WriteToTextLog("Table is empty : " + strNameTagOfTable ,2);




}//for Tables




Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your interest in Aspose products. Unfortunately, nested data is unsupported yet. See FAQ for more information. As workaround you can try using multiple templates and merge these templates during mail merge.

Best regards.

And how I know that some cell include subtable in Aspose.Words.

You have a command?


Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. No, there is no command to determine if Region contains nested region. The best way to check this is opening your document by MS Word and reviewing your document. For example the following construction in your document will cause an exception.





You can also open your document using Document Explorer (Demo application). And find nested regions.

Best reagards.

This code supports nested regions and also provides a validation function to check for nested regions before merging:



The issues you have found earlier (filed as 39) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.