@isha0705,
Please also note that the LINQ Reporting Engine is also capable to serve such simple scenario on its own. For example, please check the following code snippet and attached template documents (Docs.zip (36.8 KB)):
public class Person
{
public string Name { get; set; }
public List<Person> Children { get; set; }
}
private static List<Person> GetPersons()
{
return new List<Person>
{
new Person
{
Name = "Jane Doe",
Children = new List<Person>
{
new Person { Name = "Ann Doe" },
new Person { Name = "John Doe" }
}
},
new Person
{
Name = "John Smith",
Children = new List<Person>
{
new Person { Name = "Tom Smith" }
}
}
};
}
public void DynamicallyShowAndFillTableDependingOnCondition()
{
Document document = new Document(MyDir + "DynamicallyShowAndFillTableDependingOnCondition.docx");
ReportingEngine engine = new ReportingEngine();
engine.Options |= ReportBuildOptions.RemoveEmptyParagraphs;
engine.BuildReport(document, GetPersons(), "persons");
document.Save(MyDir + "DynamicallyShowAndFillTableDependingOnCondition Out.docx");
}
public void DynamicallyFillMultipleTablesDependingOnCollectionItems()
{
Document document = new Document(MyDir + "DynamicallyFillMultipleTablesDependingOnCollectionItems.docx");
ReportingEngine engine = new ReportingEngine();
engine.Options |= ReportBuildOptions.RemoveEmptyParagraphs;
engine.BuildReport(document, GetPersons(), "persons");
document.Save(MyDir + "DynamicallyFillMultipleTablesDependingOnCollectionItems Out.docx");
}
Hope, this helps.