Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能不能新增excel模板导出? #10

Closed
Nokecy opened this issue Oct 31, 2019 · 7 comments
Closed

能不能新增excel模板导出? #10

Nokecy opened this issue Oct 31, 2019 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@Nokecy
Copy link
Contributor

Nokecy commented Oct 31, 2019

类似 https://github.com/hanzhaoxin/ExcelReport

@xin-lai
Copy link
Collaborator

xin-lai commented Nov 1, 2019

可以考虑,不过目前精力有限。
不过建议先可以试着自己实现下,提交PR。

@xin-lai
Copy link
Collaborator

xin-lai commented Nov 5, 2019

兄台,我提供思路,你有兴趣来实现不?

@xin-lai xin-lai added the enhancement New feature or request label Nov 5, 2019
@Nokecy
Copy link
Contributor Author

Nokecy commented Nov 5, 2019

@xin-lai 可以的~~~

@xin-lai
Copy link
Collaborator

xin-lai commented Nov 5, 2019

@Nokecy 他这种模板的方式虽然直观,但是不太建议。
其实Excel、Word本质上是一个压缩包,里面由遵循Office open xml的xml等文件组成。因此我们可以根据以下思路来实现:

  1. 基于Office制作基础模板
  2. 解压模板(使用压缩工具)
  3. 提取关键Sheet的xml,基于相关规则编写Razor模板
  4. 生成相关的Sheet.xml到模板目录,然后压缩为扩展名为“.xlsx”的压缩包

完成这些之后,我们可以优化和简化整个流程

@riyuexing
Copy link

riyuexing commented Nov 23, 2019

请问大神,模板导出时支持插入图片吗?

@xin-lai xin-lai self-assigned this Jan 4, 2020
@xin-lai
Copy link
Collaborator

xin-lai commented Jan 7, 2020

请问大神,模板导出时支持插入图片吗?

暂不支持,后续会支持

@xin-lai
Copy link
Collaborator

xin-lai commented Jan 7, 2020

已完成

@xin-lai xin-lai closed this as completed Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants