R shiny buttons export formated columns
R shiny buttons export formated columns
vovo4ka
Posts: 2Questions: 1Answers: 0
The extensions 'Buttons' works great for shiny application. However it export the data without formatting. Is there a way to export data with format (e.g. percentage, or currency)?
Reproducible code
library(DT)
data.frame(a = c(1,2),
b = c(2,3)) %>%
datatable(extensions = 'Buttons', options = list(
dom = 'Bfrtip',
buttons = c('copy', 'csv', 'excel', 'pdf', 'print')) )%>%
formatPercentage('a') %>%
formatCurrency('b')
This discussion has been closed.
Answers
Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.
Information on how to create a test page, if you can't provide a link to your own page can be found here.
Thanks,
Allan
You can find examples of how to format the export output here:
https://datatables.net/extensions/buttons/examples/
Kevin
Thank @kthorngren , yes the export work in the example, however I'm having problems applying it in the shiny application.
As I mentioned, we'd need a test case. If it works in the example on this site, the issue is most likely an integration one. Hence the need for a test case .
Allan