Thanks for you’re prompt reply. I believe the issue may not be with the tables themselves, but the way I’m removing the paragraphs from the tables.
In the document template, the structure is as follows
TableStart:Claims TableStart:Messages TableEnd:Messages TableEnd:Claims
So, for each claim type, there is a list of claims, and each claim can have a list of messages. Now, when there are messages, they are linked correctly tot the Claims Table, however, for each claim record in the datatable, a new table is created in the document. I believe this is because the table start/end of claims is not contained in the same row in the table (which just isn’t possible as the messages must be after the claim row)
So to get around this in the document, I removed each of the paragraphs around each of the tables, which appeared to join all the tables to be one big ClaimTypes table, which is visible in the document supplied.
After review of the xml of the document, it hasn’t actaully merged the tables at all (even though word interpretes it that way when viewing the document) so when it’s saved to pdf, it renders the tables as it sees them. I wouldn’t care if it left the spaces there between each of the tables, but if you review the documents side by side, you’ll see that some of the claim types from the first table actually span through and under the 2nd table, which is clearly not right.
I believe the way I need to format my data is causing this issue, e.g the table layout, however, I cannot se that this can be resolved. What I need to try and do I believe is merge the tables together where I’m currently just removing the paragraphs.
Any help you can give would be much appreciated. Following is my code used to join the tables and remove the paragraphs.
ClaimTypeTable = DataSourceDataSet.Tables;
ClaimsTable = DataSourceDataSet.Tables;
Messages = DataSourceDataSet.Tables;
DataColumn master1 = new DataColumn
DataColumn slave1 = new DataColumn
claimTypeRelation = new DataRelation("claimTypeRelation", master1, slave1);
DataColumn master2 = new DataColumn
DataColumn slave2 = new DataColumn
messageRelation = new DataRelation("messageRelation", master2, slave2);
DocumentBuilder builder = new DocumentBuilder(_doc);
foreach(Table table in builder.CurrentStory.Tables)
if (table.PreviousSibling.NodeType == NodeType.Paragraph)
if (table.NextSibling.NodeType == NodeType.Paragraph)
Thanks for you time and assistance.