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

建议:写Sheet的时候,增加参数判断是否需要合并head的cell #822

Closed
lixingxing16888 opened this issue Nov 9, 2019 · 5 comments
Labels
developing This feature will be added in future releases suggest Suggest

Comments

@lixingxing16888
Copy link

版本: 2.1.1
类: WriteContextImpl.java
方法: initHead(ExcelWriteHeadProperty excelWriteHeadProperty)
代码片段:
// Combined head addMergedRegionToCurrentSheet(excelWriteHeadProperty, newRowIndex);

当前实现,是强制合并相同内容的临近cell了,有些时候可能不需要合并。
建议增加参数判断是否需要开启合并head cell。
thx!

@lixingxing16888 lixingxing16888 added the suggest Suggest label Nov 9, 2019
@zhuangjiaju
Copy link
Collaborator

可以 这个以前有人提过 忘记了。建议目前 可以稍微加个字符区别。

@zhuangjiaju zhuangjiaju added the developing This feature will be added in future releases label Nov 10, 2019
@ghost
Copy link

ghost commented Nov 11, 2019

可以指定坐标进行合并的

@weiwensangsang
Copy link
Contributor

weiwensangsang commented Nov 12, 2019

 EasyExcel.write(fileName, DemoData.class).sheet("模板").doWriteNomerge(data());

 EasyExcel.write(fileName, DemoData.class).sheet("模板").doWrite(data(), false);

这两种方式都能通过增加参数实现,且不影响doWrite(data())的正常调用。
请问对于这个问题来说哪种更好呢?
@zhuangjiaju

@pdkst
Copy link
Contributor

pdkst commented Nov 13, 2019

 EasyExcel.write(fileName, DemoData.class).sheet("模板").doWriteNomerge(data());

 EasyExcel.write(fileName, DemoData.class).sheet("模板").doWrite(data(), false);

这两种方式都能通过增加参数实现,且不影响doWrite(data())的正常调用。
请问对于这个问题来说哪种更好呢?
@zhuangjiaju

我喜欢这种的

EasyExcel.write(fileName, DemoData.class).sheet("模板").mergeHead(false).doWrite(data());

@zhuangjiaju
Copy link
Collaborator

已经在2.1.3上面加入参数automaticMergeHead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developing This feature will be added in future releases suggest Suggest
Projects
None yet
Development

No branches or pull requests

4 participants