Hi, I would like to check how I can process a complex source that has a multiple properties, and some can be a simple object, and another can be a list
for example
var data = new {company = new Company {companyName}, employees = new List<Employees>{new employee {firstName, lastname,etc}}}
in this source, the companyName should be displayed as a header. and the employees are the rows of the file.
this is my code:
// Initialize WorkbookDesigner object
WorkbookDesigner designer = new WorkbookDesigner();
// Load the template file
designer.Workbook = new Workbook(templatePath);
var company = new Company() { Name = "test company" };
// Specify the DataSource
designer.SetDataSource("data", new { company, employees = data });
// Process the markers
designer.Process(false);
// Save the Excel file.
designer.Workbook.SaveToStream().ToArray()
I used this article:
this is my template:
image.png (35.1 KB)