Dynamically Show & Fill a Single or Multiple Tables depending on Condition or Collection Items | C# LINQ Reporting
I am trying to do the same above thing, but examples ZIP file blocked by error message “Sorry, this file is private. Only visible to topic owner and staff members.” Could you please post the solution here in the thread, that it is accessible for everybody?
Thank you!
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");
}