securedeveloper / react-data-export

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

how to add 2 cells at the end of my sheet, one with static text and the other with a summed total? #175

Open DeanVanGreunen opened 2 years ago

DeanVanGreunen commented 2 years ago

My reason:

I would like to add 2 cells at the end of the sheet from my dataset, a "total" and a "value"

image

here is my code

<ExcelSheet data={this.state.dataset} name="Resellers">
    <ExcelColumn label="Month" value="month"/>
    <ExcelColumn label="Name (ID)" value="name_and_id"/>
    <ExcelColumn label="Promo Code" value="promocode"/>
    <ExcelColumn label="Money Earned" value={(col)=>{
        return "R" + (col.amount / 100);
    }}/>
</ExcelSheet>  

Lib Version:

latest