导出的excel可以按多个列来合并单元格吗
Closed this issue · 3 comments
zhujinhu21 commented
WeihanLi commented
暂时不支持单元格合并
WeihanLi commented
close this now.
希望这个库能够通过简单的配置实现同等的导入导出,这种需求只能用于导出,导入的时候就不好处理了,暂不考虑实现,多谢支持
WeihanLi commented
现在支持列合并了,详细介绍可以看这篇文章以及示例项目 https://www.cnblogs.com/weihanli/p/custom-column-support-for-weihanli-npoi.html
可以设置 HasColumnFormatter(Func<TEntity, TProperty, object> formatter)
来设置合并
setting.Property(_ => _.DisplayName)
// 多个列合并到一个列
.HasColumnFormatter((entity, displayName) => $"AAA_{entity.SettingName}_{displayName}")
.HasColumnTitle("DisplayName")
.HasColumnIndex(2);