Download Button appears with session information when printing (paper)

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).

1 Like

Hi @AntoSeti . Thank you for the image / reprex!

This is a bug (feature?) with bootstrap's default css. I've made a shiny issue to fix this as it is unexpected shiny behavior: https://github.com/rstudio/shiny/issues/2447

If you'd like to include some css in your app for now...

@media print {
  a[href]:after {
    content: none !important;
  }
}

I noticed the same thing.

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.