Download Button appears with session information when printing (paper)

#1

Hi shiny developpers,

I put a button in my shiny app, which download a table (called "tableau_final"), that i created in my code.

Howevever, when i print (on paper) the window of my app, i can see that my downloading button has sessions informations. (see image).

Download

Is there a way to delete the session informations and just to see the download button like on the shiny app when i print the document?

My code is standard :
ui part :

downloadButton("Download_Tableau.xlsx", label="Télécharger")

server part :

output$Download_Tableau.xlsx <- downloadHandler(
  filename = function() {
    paste(input$type, ".xlsx", sep = "")
  },
  content = function(file){
    fname <- paste(file,"xlsx",sep=".")
    wb <- loadWorkbook(fname, create = TRUE)
    createSheet(wb, name = "Detail")
    writeWorksheet(wb,  tableau_final, sheet = "Detail")
    saveWorkbook(wb)
    file.rename(fname,file)
  }
)

Furthermore, is there a way to produce another download button which download a .pdf/.png file (instead of a .xlsx file) of the same "tableau_final", it's a table/dataframe, nothing else, i don't need to create a .pdf file with R markdown/knitr etc, i don't want a report, nothing to "plot", just printing my table "tableau_final" generated in my code (in my mind, it's something similar to the .xlsx download button but in a .pdf/png version, but maybe i'm wrong, maybe a "print' option in the datatable from DT package exists).

0 Likes