Formula Export Support
Excel template exports now support formulas using the following syntax:
{{Formula::AVERAGE?params=G4:G6}}
{{Formula::SUM?params=G4:G6&G4}}
Multi-Column and Multi-Sheet Export
The update introduces chained programming for Excel exports with column separation:
exporter.Append(list1).SeparateByColumn().Append(list2).ExportAppendData(filePath);
For multi-sheet exports across multiple DTOs:
exporter.Append(list1).SeparateBySheet().Append(list2).ExportAppendData(filePath);
Row-based append exports with optional header information:
exporter.Append(list1).SeparateByRow().Append(list2).ExportAppendData(filePath);
ExpandoObject Support
The library now supports dynamic object exports. Example usage:
class Program
{
static async Task Main(string[] args)
{
IExporter exporter = new ExcelExporter();
var personList = GenFu.GenFu.ListOf<Person>();
string fields = "FirstName,LastName";
var expandoObjectList = new List<ExpandoObject>(personList.Count);
// Export logic implementation here
// ...
string filePath = Path.Combine(Directory.GetCurrentDirectory(), "dynamicExportExcel.xlsx");
var result = await exporter.ExportAsByteArray<ExpandoObject>(expandoObjectList);
File.WriteAllBytes(filePath, result);
}
}
class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Title { get; set; }
public int Age { get; set; }
public int NumberOfKids { get; set; }
}
For more release details, visit: