revised table export
Some checks failed
pkgdown.yaml / pkgdown (push) Has been cancelled

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-12-12 18:09:06 +01:00
commit ed74e0492c
No known key found for this signature in database
7 changed files with 54 additions and 41 deletions

View file

@ -1,7 +1,7 @@
########
#### Current file: /var/folders/9l/xbc19wxx0g79jdd2sf_0v291mhwh7f/T//RtmpaYL5kU/file9c716ca74d18.R
#### Current file: /var/folders/9l/xbc19wxx0g79jdd2sf_0v291mhwh7f/T//RtmpaYL5kU/file9c715011d086.R
########
i18n_path <- system.file("translations", package = "FreesearchR")
@ -9855,7 +9855,7 @@ table_download_ui <- function(id, title = "Table", ...) {
selected = NULL,
choices = list(
"MS Word" = "docx",
"Open document format" = "rtf"
"Compatible (rtf)" = "rtf"
)
),
shiny::br(),
@ -9910,11 +9910,14 @@ table_download_server <- function(id, data, file_name = "table", ...) {
data = table,
filename = file # Save to the file path provided by downloadHandler
)
if (type == "docx") {
out |> doconv::docx_update()
} else {
out
}
# This only works locally and was disabled
# if (type == "docx") {
# out |> doconv::docx_update()
# } else {
# out
# }
out
},
error = function(err) {
shiny::showNotification(paste0(i18n$t("Error: "), err), type = "error")
@ -14114,14 +14117,16 @@ server <- function(input, output, session) {
output_format = format,
input = file.path(getwd(), "www/report.rmd")
)
# This only works locally and was disabled
# if (type == "docx") {
# ## This handles the the following MS Word warning:
# ## >> "This document contains fields that may refer to other files."
# out |> doconv::docx_update()
# } else {
# out
# }
if (type == "docx") {
## This handles the the following MS Word warning:
## >> "This document contains fields that may refer to other files."
out |> doconv::docx_update()
} else {
out
}
out
},
error = function(err) {
showNotification(paste0(i18n$t("We encountered the following error creating your report: "), err), type = "err")