0

I am using following code in Shiny-UI to pass variable value through link but this is not working.

"href= paste("http://10.219.5.109:8597/apps/cc_new/?cc_input=",input$cc)"

How can i pass variable value?

here is the ui-server parts:

  ui <- dashboardPage(
  dashboardHeader(title = h4("Costcenter Invoice Trend")),
  dashboardSidebar(
    textInput("cc_input", label = h4("Enter Costcenter"), value = get_quarter()),
    h6("(Default is Costcenter with highest deviation)"),

    submitButton("Submit")

  ),
  dashboardBody(
        rpivotTableOutput("mypivot", width = "100%", height = "100%"),

        h4("Costcenter Invoice Analysis!",a(href= paste("http://10.219.5.109:8597/apps/?cc_input=",input$cc_input)))


))



server <- function(input, output,session) {

  output$mypivot = renderRpivotTable({


    got_data<-get_data(input$cc_input)
    options(scipen=999)
    rpivotTable(data=got_data, col="Quarter", rows = "Vendor", aggregatorName="Sum", vals = "Tool_Cost",
                rendererName="Line Chart")



  })
}

shinyApp(ui, server)
user6559913
  • 483
  • 4
  • 7
  • 15
  • Try `paste0()`. By default `paste()` inserts a space between terms. Otherwise, clarify what "not working" means exactly. – MrFlick Mar 06 '17 at 14:38
  • I was facing white space issue when i tried passing any hardcoded value e.g "1324" in place of input$cc but i fixed that. This link creation part i have kept in UI portion and on running the script it is not able to take up input$cc value. I am not getting how can i bind variable to this link. – user6559913 Mar 06 '17 at 15:44
  • That's not very clear from this question. You should try to provide a minimal, [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) showing exactly where you were trying to run this code. – MrFlick Mar 06 '17 at 15:49
  • I have included the ui-server parts in the question – user6559913 Mar 06 '17 at 15:55
  • The UI does not have access to `input`. You need to build the link on the server and include in the page with `htmlOutput` as is done in the question marked as a duplicate. – MrFlick Mar 06 '17 at 16:27

0 Answers0