DataTable exportCSV when column has body prop

UI Components for React
Post Reply
Posts: 22
Joined: 07 Jan 2018, 14:12

27 Jan 2019, 14:11


I have a DataTable with body props, when exportCSV is used these cells appear as undefined? Is there an answer to this?


Posts: 601
Joined: 12 Sep 2017, 10:44

15 Feb 2019, 16:36

We tried in datatable-templating page like;

Code: Select all

<DataTable value={} header={header} footer={footer} ref={(el) => { this.dt = el; }}>
                        <Column field="vin" header="Vin" />
                        <Column field="year" header="Year" />
                        <Column field="brand" header="Brand" body={this.brandTemplate} style={{textAlign:'center'}}/>
                        <Column field="color" header="Color" body={this.colorTemplate} />
                        <Column body={this.actionTemplate} style={{textAlign:'center', width: '8em'}}/>
but we didnt see your issue ? Please, could you send your code or create an example like this ?

Posts: 1
Joined: 12 Nov 2019, 19:11

12 Nov 2019, 19:16

Is this issue resolved? I have the same issue. I use body prop to format the data in a column. When I try to use exportCSV on datatable, the format is not preserved. As a result, the csv file shows [object] in these columns. I am wondering if there is a way to format data before using exportCSV. Thanks!

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 0 guests