【发布时间】:2020-06-22 13:56:35
【问题描述】:
有没有办法下载带有自定义文件名的excel。下面使用默认的 excel 名称下载。我们可以定制吗?比如“df.xlsx”
DT::datatable(df,
escape = FALSE, rownames = FALSE,selection = 'single',
extensions = c('Buttons'),
options = list(
scrollX = TRUE,
paging = TRUE,
buttons = c('excel'),
columnDefs = list(list(visible=FALSE, targets=c(2))),
pageLength = 400, sScrollY = '40vh',
autoWidth = FALSE,
buttons = list('copy', 'print',
list(
extend = 'collection',
buttons = c('csv', 'excel'),
text = 'Download'
))
)
)
【问题讨论】:
-
在 github 上查看以下帖子 --> github.com/rstudio/DT/issues/409 - 它完全涵盖了您的主题!