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

【BUG】模板导出相同的代码升级成FastExcel后出现数据丢失、样式丢失问题 #206

Open
LeYunone opened this issue Jan 21, 2025 · 0 comments

Comments

@LeYunone
Copy link

LeYunone commented Jan 21, 2025

版本

fastexcel:1.1.0
easyexcel:3.1.1

Bug描述

以下为导出文件效果:
EasyExcel:
Image

FastExcel:

Image

Demo

项目地址见:https://github.com/LeYunone/demo-project/tree/master/demo-fastexcel

代码

导出代码为:

    public void export() throws IOException {
        File file = new File("export-mode.xlsx");
        File tempFile = new File("f://test.xlsx");
        ExcelWriter excelWriter = EasyExcel.write(tempFile)
                .withTemplate(new FileInputStream(file))
                .build();
        WriteSheet writeSheet = EasyExcel.writerSheet().build();
        FillConfig horizontalFillConfig = FillConfig.builder().direction(WriteDirectionEnum.HORIZONTAL).build();
        FillConfig verticalFillConfig = FillConfig.builder().forceNewRow(false).direction(WriteDirectionEnum.VERTICAL).build();
        
	//---- head 头部表格
        excelWriter.fill(new FillWrapper(TestHeadData.class.getSimpleName(), head), horizontalFillConfig, writeSheet);
        
	//---- testDataList 表身内容
        excelWriter.fill(new FillWrapper(TestData.class.getSimpleName(), testDataList), verticalFillConfig, writeSheet);
        excelWriter.finish();
    }

奇怪的问题🧐

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

1 participant