You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
我按照模板填充的教程自己写的,结果似乎并不支持二级类的访问的集合模板导出,是这样的吗
public class AA
{
public Employee Employee { get; set; }
public Manager Manager { get; set; }
}
public class Employee
{
public string Name { get; set; }
}
public class Manager
{
public string Name { get; set; }
}
static void Main(string[] args)
{
Manager manager = new Manager() { Name = "张三" };
Employee employee = new Employee() { Name = "李四" };
AA aA = new AA() { Employee = employee, Manager = manager };
AA aA2 = new AA() { Employee = employee, Manager = manager };
List<AA> aAs = new List<AA>() { aA, aA2 };
var value = new
{
aAs
};
try
{
MiniExcel.SaveAsByTemplate("AAA.xlsx", @"模板.xlsx", value);
}
catch (Exception ex)
{
return;
}
}
Activity
tomexou commentedon Aug 1, 2023
You can use @group...@endgroup keyword in your template files.