Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export to CSV download only specific columns #564

Closed
anvk opened this issue Jul 15, 2016 · 9 comments
Closed

Export to CSV download only specific columns #564

anvk opened this issue Jul 15, 2016 · 9 comments

Comments

@anvk
Copy link

anvk commented Jul 15, 2016

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 !

@anvk anvk changed the title Export to CSV download only specific rows Export to CSV download only specific columns Jul 15, 2016
@annelorraineuy
Copy link

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? :)

@AllenFang
Copy link
Owner

hey all, I can give a props noExport on TableHeaderColumn. if noExport assigned, that column will not be exporting in the csv file

AllenFang added a commit that referenced this issue Jul 16, 2016
@AllenFang
Copy link
Owner

HI all, released on v2.3.8 and check example

use export={false} to tell react-bootstrap-table doesn't export that column !

@anvk
Copy link
Author

anvk commented Jul 18, 2016

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.

@AllenFang
Copy link
Owner

surely, I'll add in docs. Thanks your :)

@SmashedBird
Copy link

Hey @AllenFang , Do we have a prop we can pass to specify the filename/Spreadsheet title instead of "Table 1" ?

@AllenFang
Copy link
Owner

@SmashedBird you can use csvFileName on BootstrapTable to specified the file name. But we can not configure the Spreadsheet title. Thanks

@christianbalderrama
Copy link

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

@Manu12bollineni
Copy link

Manu12bollineni commented Feb 4, 2021

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants