securedeveloper / react-data-export

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

How use formula in dataSat #103

Open mbohovic opened 5 years ago

mbohovic commented 5 years ago

My dataset is

dataSet =  [{
                columns: [
                    {title: "A", style: {font: {bold: true}}, width: {wpx: 200}}, // pixels width
                    {title: "B", style: {font: {bold: true}}, width: {wch: 10}}, // char width
                    {title: "C", style: {font: {bold: true}}, width: {wpx: 90}},
                ],
                data: this.props.sourceData.reduce((acc, item) => {
                    acc.push([
                        {value: item.A},
                        {value: item.B},
                        {value: =SUM(item.A;item.B)},
                    ])
                    return acc
                }, [])
            }]
...
<ExcelSheet dataSet={dataSet)} />

How set =SUM(itemA;itemB) ??

Thanks