1

An example.html gets created in a local directory by another script. Until then, Shiny UI should show an empty screen, and when the example.html gets generated, it should be reflected in Shiny UI.

The example.html is loaded into the Shiny UI, but it is not getting reflected.

This is the code I've tried, at least for displaying the file

Code:

ui = shinyUI(fluidPage(titlePanel("Generated Report"),
                       mainPanel(htmlOutput("showfile"))
                       )
             )

server = function(input, output, session){
  output$showfile <- renderUI({
    includeHTML("C://Users//DELL//Desktop//abc_files//www//report.html")
    # HTML(readLines(file_to_show))
  })

}

shinyApp(ui, server)
hat
  • 781
  • 2
  • 14
  • 25

1 Answers1

1

If you want to display the ...report.html file in your shiny app, the // in your path-to-file are not correct.

This script (with a single /) will display the HTML file.

ui = shinyUI(fluidPage(titlePanel("Generated Report"),
                   mainPanel(htmlOutput("showfile"))
                   )
         )

server = function(input, output, session){
  output$showfile <- renderUI({
    includeHTML("C:/Users/DELL/Desktop/abc_files/www/report.html")
    # HTML(readLines(file_to_show))
  })

}

shinyApp(ui, server)
Arthur
  • 174
  • 1
  • 1
  • 10