dotnetcore / dotnetcore/Magicodes.IE

多个数据源按Sheet拆分导出无法导出多个List<ExpandoObject>

Open
#328 1 comment 0 reactions 0 assignees View on GitHub
area-excel
Dominant language
C#
Stars
2.2k
Forks
495
PR merge metrics
No merged PRs in 30d

Description

由于需要导出多个列,我这边参照这个文档想要实现**多个数据源按Sheet拆分导出**
![image](https://user-images.githubusercontent.com/33503274/132789805-f39c7f72-bac8-4de3-a553-341b01010de7.png)

但是发现像这样传入多个List对象是会报错的,传一个List是支持的
![image](https://user-images.githubusercontent.com/33503274/132790074-703a2a9b-6816-4fd8-a3ed-2e89712e466e.png)

然后查看源码,发现第一次IsExpandoObjectType会被识别为true,第二次识别为false
![image](https://user-images.githubusercontent.com/33503274/132790691-d3365a47-e131-4c4d-a385-8b438fac6ba1.png)

没怎么仔细看代码,但是简单修改了一下这样是可正常执行的,也能满足我需求了

ExportHelper修改:
![image](https://user-images.githubusercontent.com/33503274/132791566-47e85a7c-a6f8-4a69-a57b-adeadb950f76.png)

ExcelExporter修改:

![image](https://user-images.githubusercontent.com/33503274/132791536-15cdefb0-3693-459f-bf6b-a3e30729658e.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.