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

Is it possible to download reactable as csv? #182

Closed
rdatasculptor opened this issue Aug 3, 2021 · 4 comments
Closed

Is it possible to download reactable as csv? #182

rdatasculptor opened this issue Aug 3, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@rdatasculptor
Copy link

For a project I work on it is sometimes needed to be able to download the table and work on it in more details in e.g. excel.
Is it somehow possible to export a reactable as plain text file, such as csv?

Many thanks in advance!

@lukr90
Copy link

lukr90 commented Aug 4, 2021

What kind of environment do you have your reactable in? For example, in a Shiny app you can add a shiny::downloadHandler() that allows the user to download the same data (also reactive) that goes into the table.

@rdatasculptor
Copy link
Author

it's a standalone webpage. For now I solved it by adding a hyperlink to a csv file. But I was just wondering if there was a possibility within reactable.

@glin
Copy link
Owner

glin commented Sep 5, 2021

For standalone pages, a hyperlink to the raw data is a great solution. I use hyperlinks to raw data in all the reactable demos, like Twitter Followers:

Raw data: [`twitter_followers.csv`](twitter_followers.csv)

For Shiny apps, shiny::downloadHandler() works well and provides more control over the download, as @lukr90 mentions.

For something like a download button that exports table data with filters and sorting applied, that's not possible today, but it is an open feature request (#11). The table data is available through custom JS render/style functions (via state.sortedData), but just isn't easily accessible from outside the table yet.

@glin
Copy link
Owner

glin commented Nov 8, 2021

This is now possible to do from a standalone web page using the new JavaScript API in the development version (0.2.3.9000). A hyperlink to the raw data is still a great solution IMO, but you can use a CSV download button if the hyperlink isn't possible, or if you want users to be able to download a filtered dataset. See #11 (comment) for more details and examples.

@glin glin closed this as completed Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants