Swechhya / excelR

An Interface to 'jExcel.js' Library
https://swechhya.github.io/excelR/
Other
152 stars 19 forks source link

colnames are missing when download CSV file using "toolbar" add-in #100

Open zhangjunjiang opened 2 years ago

zhangjunjiang commented 2 years ago

It's quite convenient to use this tool in shiny app This is a simple bug I meet, but I think it's also very important😁😁

I have a table output like this :

excelOutput("flocu",width = "100%"))
output$flocu <- renderExcel(excelTable(data = tmp,columns=columns,showToolbar=TRUE))

When I try to download the table by click the "save" button in the toolbox, I can see the saved csv file. But this file don't have the colnames.

Expected behavior I hope colnames can be saved in the csv file. Also I think it's good to make user to set the filename, not only use the default name "jexcel"

Desktop (please complete the following information):

zhangjunjiang commented 2 years ago

I got the #100 🥳🥳🥳🥳

PablaOO7 commented 2 years ago

@zhangjunjiang you can add includeHeadersOnDownload = TRUE this to your code. This will update default setting from false and allow you to download csv with colnames. Hope this helps.😊

output$flocu <- renderExcel(excelTable(data = tmp,columns=columns,showToolbar=TRUE, includeHeadersOnDownload = TRUE))