Skip to content

[Bug] Merge error in dynamic header #666

@delei

Description

@delei

Search before asking

  • I searched in the issues and found nothing similar.

Fesod version

1.3.0

JDK version

JDK1.8

Operating system

No response

Steps To Reproduce

public class IssueTest {

    @Test
    public void dynamicHeadWrite() throws Exception {
        List<List<String>> multiHeader = new ArrayList<>();
        multiHeader.add(new ArrayList<>(Arrays.asList("head10")));
        multiHeader.add(new ArrayList<>(Arrays.asList("head20", "head21")));
        multiHeader.add(new ArrayList<>(Arrays.asList("head30", "head31")));
        multiHeader.add(new ArrayList<>(Arrays.asList("head40", "head31")));
        multiHeader.add(new ArrayList<>(Arrays.asList("head40", "head41")));
        FastExcel.write("dynamicHeadWrite" + System.currentTimeMillis() + ".xlsx")
                .head(multiHeader)
                .sheet()
                .doWrite(data());
    }

    private List<List<Object>> data() {
        List<List<Object>> data = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            data.add(new ArrayList<>(Arrays.asList("A" + i, "B" + i, "C" + i, "D" + i, "E" + i)));
        }
        return data;
    }
}

Current Behavior

Cells C2 and D2 are automatically merged.
Image

Expected Behavior

Cells C2 and D2 should not be merged automatically.

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions