securedeveloper / react-data-export

Export dataset in react.
https://securedeveloper.github.io/react-data-export/
MIT License
179 stars 194 forks source link

Support for header groups #98

Open JTFlavier-Cob opened 5 years ago

JTFlavier-Cob commented 5 years ago

Hello there! Thank you for creating this library. It has been very helpful.

Does this library currently support header groups? I am using react-table to render tables with header groups that look like this (this table goes on until December):

image

The JSON input for react-table looks something like this:

[
    {
        name: "Alpha",
        age: 23,
        sex: "F",
        salary: 3213, 
        months: [
            {
                month: "Jan",
                income: 12312,
                expense: 23,
                profit: 12289
            }, 
            {
                month: "Feb",
                income: 345624,
                expense: 23,
                profit: 345601
            },
            ...
        ]
    },
    ...
]

By setting up react-table's columns parameter in a nested manner, I am able to make the table seen above.

Given the data structure above, is it possible for me to export an excel file that looks like the example?

securedeveloper commented 5 years ago

unfortunately, it is not supported with header columns, only way was the one you already tried :)