Issues generating downloadable reports from shiny-server - word_document

Split from the original thread: Generating downloadable reports (rmarkdown) : reference_docx (yaml header) is not read by knitr


have tried using word_document() and absolute paths as suggested above, but this has made no difference.

It is odd because it works as expected on rstudio server but not shiny server; even though they are running on the same machine.

I am using absolute paths in with temporary folders, so /tmp/RtmpnWjfwF/oGLv9Kz/template.docx . Could this be causing a problem? Both .Rmd and template.docx are in the same temporary folder.


thanks for the quick reply, unfortunately I am still getting the same behaviour. So, style works fine on rstudioserver but not once deployed to shinyserver. This is all running on an Ubuntu machine, but both servers are using the same system R install.

I have included below the error message I get from word (not very informative) and the render and yaml code chucks. Any further suggestions or advice would be greatly aprpeciated.

word_error

        rmarkdown::render("/tmp/RtmpnWjfwF/YY7KrNO/report.Rmd",
                          'word_document',
                          knit_root_dir = "/tmp/RtmpnWjfwF/YY7KrNO",
                          output_file = file,
                          clean = FALSE,
                          params = params,
                          envir = new.env(parent = globalenv())
        )

And the yaml:


---
output:
  word_document:
    reference_docx: photo_log_template.docx
params:
  organisation: NA
  photographer: NA
  df: NA
---


thanks again

Matt

Would it be very difficult to create a minimal reproducible example, and post it as an issue at https://github.com/rstudio/rmarkdown? This seems like a real issue but I don't know if any one person knows rmarkdown and shiny well enough to diagnose this without a working reprex.

Thanks...

1 Like

Thanks for your response, I am just testing on another computer. This will give me a repex so if I get the same problem I will post the issue to github. I will report back here as well.

Thanks @jcheng I have just submitted an issue with reprex. Please advise if more details are required.