Hi, I need to nest data tables, however, when doing this each row in the parent table is generating a new table and I need it to only generate one table.
My base table called HOSPITAL has a relation HOSPITAL_MSG, as seen below.
HosTable = dataSet.Tables[0];
HosTableMsg = dataSet.Tables[1];
DataRelation hosRelation;
DataColumn[] master1 = new DataColumn[]
{
HosTable.Columns["ClaimNo"], HosTable.Columns["ClaimLineNo"]
};
DataColumn[] slave1 = new DataColumn[]
{
HosTableMsg.Columns["ClaimNo"], HosTableMsg.Columns["ClaimLineNo"]
};
hosRelation = new DataRelation("hosRelation", master1, slave1);
dataSet.Relations.Add(hosRelation);
This relation is working fine. I’ve used your RemoveEmptyRegions solution with version 9.3 to remove any empty StartTable/EndTable and mergefields that haven’t been populated by the inner table, and that also works fine.
I believe to do what I’m after I’d need the StartTable/EndTable to be in a row, (currently for the parent table they are outside of the table) and then the child table needs to somehow sit inside of the StartTable/Endtable for the parent table, however, I can’t see that this is possible.
I’ve attached a sample of my document template, and the generated results. I’ve then attached a copy of the document as I’d like to see it. In this example, I’ve manually mapped the lines data table and created the rows and inserted them in the correct location, however, this isn’t very elegant as there are no merge fields defined on the document for the child tables rows.
If you need further info, please contact me.