title: R shiny, cannot find the function
body: <p>I have a shiny application that contains 2 tabs. In the second tab i run an SQL query to get back a data-frame which i want to post on screen so the user can see. For brevity i have only included the relevant code. Basically the user selects a date range, this goes to the database and pulls the relevant information and returns that information to the server to post to the screen. Currently when run the app i get the error message</p>
  
  <blockquote>
    <p>Error: could not find function "report_data"</p>
  </blockquote>
  
  <p>I would be grateful for any help you could provide</p>
  
  <pre><code>#-----------------------------------------------------------------------------------------
  # UI    
  # TAB 2 which lets the user select a date range and press the submit button
  #-----------------------------------------------------------------------------------------
  tabPanel("Review Uploaded Data", 
                    # Side Panel with Options
                    fluidRow(
                      column(4, wellPanel(
                        id = "leftPanel",
  
                        div(id = "Header",
                            h3("Options", align = "center"),
                            tags$hr()
                        ),
  
                        div(id = "form2",
  
                            dateRangeInput("dates", label = h3("Entry Date Range")),
                            actionButton("search", "Search Database", class = "btn-primary")
  
                        )
                      )),
  
                      column(8, id = "reporttable",
                             # Main Panel shows the uploaded excel document when a user first uploads
                             DT::dataTableOutput("reportTable")
  
                      )))
  
  
  #-----------------------------------------------------------------------------------------
  # Server    
  # TAB 2 Review Uploaded Data
  #-----------------------------------------------------------------------------------------
  
  
  # When User selects a date Range. Run the SQL to pull information for that Date Range
  report_data &lt;- observeEvent(input$search, {
    load_data(input$dates)
  })  
  
  # Show the summary table
  output$reportTable &lt;- DT::renderDataTable(
    DT::datatable(
      report_data (),
      rownames = TRUE,
      options = list(searching = FALSE, lengthChange = FALSE, scrollX = FALSE)
    ))
  </code></pre>
  
  <p>This function is the function that goes to the database and returns the dataframe based on the users selections of a date range.</p>
  
  <pre><code># Load the data from the MYSQL table
  load_data &lt;- function(dateRange) {
    # Connect to the database
    db &lt;- dbConnect(MySQL(), dbname = databaseName, host =  options()$mysql$host, 
                port = options()$mysql$port, user = options()$mysql$user, 
                password = options()$mysql$password)
  
  
    start_date &lt;- dateRange[1] 
    end_date &lt;- dateRange[2]
  
    # Construct the fetching query
    query &lt;- sprintf("SELECT USER, COUNT(*) as records FROM %s
  WHERE ENTRY_DATE BETWEEN '%s' AND '%s' GROUP BY 1", table, start_date,     end_date)
  
    # Submit the fetch query and disconnect
    data &lt;- dbGetQuery(db, query)
    dbDisconnect(db)
    names(data) &lt;- c("User", "records")
  
    return(data)
  }
  </code></pre>