Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/73.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R shinny-使用server.R中UI.R的htmlOutput/uiOutput作为输入_Html_R_Shiny_Render - Fatal编程技术网

R shinny-使用server.R中UI.R的htmlOutput/uiOutput作为输入

R shinny-使用server.R中UI.R的htmlOutput/uiOutput作为输入,html,r,shiny,render,Html,R,Shiny,Render,在我闪亮的仪表板中,我正在生成复杂的SQL,它接受用户的输入,生成SQL代码,并在用户输入用户名/密码后执行 我在UI.R中生成一个htmlOutput,在代码运行之前显示代码 当显示为textOutput时,该代码包含换行符br()、包含在em()中的注释和闪亮的html输出div元素 我的目标是能够使用htmlOutput作为sqlQuery函数的输入 SERVER.R的部分 qry_SQL <- reactive({tempfunc(1, "TD")}) # tempfunc cre

在我闪亮的仪表板中,我正在生成复杂的SQL,它接受用户的输入,生成SQL代码,并在用户输入用户名/密码后执行

我在UI.R中生成一个htmlOutput,在代码运行之前显示代码

当显示为textOutput时,该代码包含换行符br()、包含在em()中的注释和闪亮的html输出div元素

我的目标是能够使用htmlOutput作为sqlQuery函数的输入

SERVER.R的部分

qry_SQL <- reactive({tempfunc(1, "TD")})
# tempfunc creates my SQL using inputs present in UI.R

output$qry_out_text <- renderText(qry_SQL())
#Generates output in text format that contains <br/>, <em> and <div id="key1A_main_TD_1" class="shiny-html-output"> elements

output$qry_out_text2 <- renderUI(qry_SQL())
# Generates html output that I would ideally like to pass to sqlQuery

output$qry_out <- renderDataTable({
    input$Execute
    validate( 
      need(input$Username!=""&&input$Password!="","Please input Username and Password for TERADATA"),
      need(input$Execute>0,"Click Execute")
    ) 

    ch <- odbcConnect(dsn="CustomDSN",uid=input$Username, pwd = input$Password)

    import <<- sqlQuery(ch, PASS_HTML_OUTPUT_HERE, errors = FALSE    )    
    odbcClose(ch)   
    head(import, n =100)
  })
我的问题是,我希望将qry_SQL()作为HTML传递,并解决div标记

干杯,
Anand

你能发布一个HTML示例吗?您想保存HTML还是从HTML中提取SQL查询?从代码的内容来看,似乎您想使用
qry\u SQL()
。但是
temoofunc
看起来好像没有从用户那里得到
输入。。。如果没有一个可复制的示例,很难判断。嗨,我已经更新了这个问题,将qry_SQL()的值包括为textOutput和htmlOutput。我基本上希望在将qry_SQL()传递给sqlQuery()函数时解析div标记。您可以发布一个HTML示例吗?您想保存HTML还是从HTML中提取SQL查询?从代码的内容来看,似乎您想使用
qry\u SQL()
。但是
temoofunc
看起来好像没有从用户那里得到
输入。。。如果没有一个可复制的示例,很难判断。嗨,我已经更新了这个问题,将qry_SQL()的值包括为textOutput和htmlOutput。我基本上希望在将qry_SQL()传递给sqlQuery()函数时解析div标记
SELECT c1.COL1, c1.COL2
FROM TABLE as c1  
WHERE cast(c1.DateNow as date) between '2015-09-19' and '2015-10-16'
and <div id="key1A_main_TD_1" class="shiny-html-output"></div>
<div id="key2A_main_TD_1" class="shiny-html-output"></div>
<div id="key3A_main_TD_1" class="shiny-html-output"></div>
<div id="key4A_main_TD_1" class="shiny-html-output"></div>
<div id="key5A_main_TD_1" class="shiny-html-output"></div>   
SELECT c1.COL1, c2.COL2
FROM TABLE1 as c1 
WHERE cast(c1.DateNow as date) between '2015-09-19' and '2015-10-16'
and
(c1.Details like '%unhappy%')