How to export nested array of objects into xlsx format in React.js

383 Views Asked by At

I don't figure out how to export nested data to xlsx format. I'm currently using react-export-data package and this package don't accept objects. Structure of data looks like this:

const test =  {
"id":25,
"office":"Офис Исфана",
"full_name":"Адамбаев Суйунбек Аматжанович",
"model_car":"Tesla",
"number_car":"АИ599",
"registry_driver":[
    {
        "id":13,
        "driver":"Адамбаев Суйунбек Аматжанович",
        "date":"2021-09-13",
        "name_weekday":"Mon",
        "start_fuel":"0.00",
        "flooded_fuel":0,
        "milage":420647,
        "costs_fuel":"8412.94",
        "end_fuel":"-8412.94",
        "num_card":{
        },
        "num_check":{
        }
    },
    {
        "id":22,
        "driver":"Адамбаев Суйунбек Аматжанович",
        "date":"2021-09-14",
        "name_weekday":"Tue",
        "start_fuel":"-8412.94",
        "flooded_fuel":0,
        "milage":0,
        "costs_fuel":"0.00",
        "end_fuel":"-8412.94",
        "num_card":{
        },
        "num_check":{
        }
    }
]

}

I need to get output like this: enter image description here

I really hope for your help...

0

There are 0 best solutions below