Export data from Excel Sheet

shiny
rstudio

#1

Hi guys!

I'm trying to read a file from Excel and show it in Shiny App.

UI CODE

        fileInput(inputId = "Planilha",placeholder = "Selecione a planilha", buttonLabel = "Upar", label = "Ou selecione a planilha do Ys", multiple = FALSE, accept = ".xlsx")

  tableOutput("planilhaYs")

SERVER CODE

output$planilhaYs <- renderDataTable({ 
    input$Planilha
    
    df<-read_excel(input$Planilha$datapath, sheet = 1)
    return(df)  
    }
    )

Extension: .xlsx

But, no data appears.


#2

Please have a look at 'create table output element' documentation.

renderTable should be used for tableOutput(outputId) instead of renderDataTable.

In your Server part, try replacing renderDataTable with renderTable (or on the other hand use dataTableOutput("planilhaYs") at UI)