Is it possible to export data from a ui.table data as a CSV file? #3068
Unanswered
Swasthik-Jain
asked this question in
Q&A
Replies: 1 comment
-
Hi @Swasthik-Jain, You can use Python to create a CSV file and trigger a download like this: def export_csv():
with open('data.csv', 'w') as file:
writer = csv.DictWriter(file, fieldnames=[column['name'] for column in columns])
writer.writeheader()
writer.writerows(rows)
ui.download('data.csv')
ui.button('Export to CSV', on_click=export_csv) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
I'm able to export the data from ui.grid but I wanted to know is it possible to exports ui.table contents as .csv file
In the provided code snippet, I have both a grid and a table. I've managed to export data from the grid as a CSV file. However, I'm uncertain if the same functionality exists for exporting data from the table as a .CSV file
Beta Was this translation helpful? Give feedback.
All reactions