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 总是自带一个默认的空sheet1 #1235

Closed
Rekoe opened this issue Nov 19, 2020 · 1 comment
Closed

自定义的sheet 总是自带一个默认的空sheet1 #1235

Rekoe opened this issue Nov 19, 2020 · 1 comment

Comments

@Rekoe
Copy link

Rekoe commented Nov 19, 2020

版本情况

JDK版本: openjdk_8_201
hutool版本: 5.3.9(请确保最新尝试是否还有问题)

问题描述

  1. 复现代码
ExcelWriter writer = ExcelUtil.getWriter("test.xlsx");
		writer.setSheet("Sheet2");
		writer.addHeaderAlias("tid", "订单号");
		List<NutMap> rows = Lists.newArrayList();
		rows.add(NutMap.NEW().setv("tid", "1000"));
		writer.write(rows, true);
		writer.close();

生成的xlsx文件中 总是多一个空白的sheet1 请问这个默认的sheet怎么不带呢?如果自定义了一个sheet后

@Rekoe Rekoe changed the title 自定义的sheet 总是自带一个默认的空sheet 自定义的sheet 总是自带一个默认的空sheet1 Nov 19, 2020
@looly
Copy link
Member

looly commented Nov 19, 2020

public static ExcelWriter getWriter(File destFile, String sheetName)

用这个指定sheet。

@looly looly closed this as completed Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants