Export to CSV download only specific columns
I hope it is not too hard to add functionality to this component to be able to download not ALL columns in a table through "Export to CSV" button. I have some columns where I keep Edit/Delete links and they appear in CSV whenever user clicks ExportToCSV button.
Thanks !
I have the same request. I have a column named "Actions" that has add/edit/delete buttons that get included in the export too. Maybe there can be a key that would specify that the column wouldn't be included on exportCSV? :)
hey all, I can give a props noExport on TableHeaderColumn. if noExport assigned, that column will not be exporting in the csv file
HI all, released on v2.3.8 and check example
use export={false} to tell react-bootstrap-table doesn't export that column !
Thanks a lot @AllenFang . It would be great to add documentation for this flag. Because some people would wonder if hidden={true} means export={false} by default.
surely, I'll add in docs. Thanks your :)
Hey @AllenFang , Do we have a prop we can pass to specify the filename/Spreadsheet title instead of "Table 1" ?
@SmashedBird you can use csvFileName on BootstrapTable to specified the file name. But we can not configure the Spreadsheet title. Thanks
By default when you added the flag hidden to the TableHeaderColumn it automatically set the export to that particular column to false so when you want to hide a specific column but still want to export that column you can do export = {true} in order to override what is set by default
@AllenFang @SmashedBird i found one solution to configure the spreadsheet name, by adding example : document.title = 'products'; in componentdidmount event of your component or anywhere where your grid is present.
so that this title will apply to your spreadsheet.