We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
public static void main(String[] args) throws Exception { // 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"{","}"代替 String templateFile = "/Users/super_song/Downloads/IntlContractTemplate.xlsx"; String targetFileName = "/Users/super_song/Downloads/testNew.xlsx"; // 创建一个工作簿对象 ExcelWriter workBook = EasyExcel.write(targetFileName).withTemplate(templateFile).build(); // 创建工作表对象 WriteSheet sheet = EasyExcel.writerSheet().build(); FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); // 准备数据 List students = initFillData(); // 多组数据填充 workBook.fill(students, fillConfig, sheet); // 关闭流 !!! workBook.finish(); } 我的Excel主要分成三部分,头部是固定的内容,中间是动态插入数据的区域,底部是固定的内容。三部分都存在样式。 现在遇到的问题是我能成功插入数据,但是插入的数据会破坏底部的样式已经会覆盖底部的内容。
The text was updated successfully, but these errors were encountered:
FillConfig需要设置direction = WriteDirectionEnum.VERTICAL,forceNewRow(Boolean.TRUE)才能生效。
direction = WriteDirectionEnum.VERTICAL
forceNewRow(Boolean.TRUE)
FillConfig fillConfig = FillConfig.builder() .setDirection(WriteDirectionEnum.VERTICAL) .forceNewRow(Boolean.TRUE) .build() // or // FillConfig fillConfig = FillConfig.builder() // .forceNewRow(Boolean.TRUE) // .build() // .init()
Sorry, something went wrong.
frankggyy
Successfully merging a pull request may close this issue.
public static void main(String[] args) throws Exception {
// 模板注意 用{} 来表示你要用的变量 如果本来就有"{","}" 特殊字符 用"{","}"代替
String templateFile = "/Users/super_song/Downloads/IntlContractTemplate.xlsx";
String targetFileName = "/Users/super_song/Downloads/testNew.xlsx";
// 创建一个工作簿对象
ExcelWriter workBook = EasyExcel.write(targetFileName).withTemplate(templateFile).build();
// 创建工作表对象
WriteSheet sheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
// 准备数据
List students = initFillData();
// 多组数据填充
workBook.fill(students, fillConfig, sheet);
// 关闭流 !!!
workBook.finish();
}
我的Excel主要分成三部分,头部是固定的内容,中间是动态插入数据的区域,底部是固定的内容。三部分都存在样式。
现在遇到的问题是我能成功插入数据,但是插入的数据会破坏底部的样式已经会覆盖底部的内容。
The text was updated successfully, but these errors were encountered: