Forum Discussion

chriswalz's avatar
chriswalz
Regular Visitor
8 years ago
Solved

custom R visual runtime error (access denied to local url)

Hi,

 

I have created a custom Power BI visual using this http://radacad.com/interactive-map-using-r-and-power-bi-create-custom-visual-part-1 tutorial. I'm using Plotly to create a interactive chart in this visual.

I can use this custom visual without any problems in power BI desktop, but when I publish it to powerbi.com, I receive the following error "script runtime error":

Error in shell.exec(url) : access to 'C:\Users\Client\Temp\RtmpOsE2VBviewhtml1c717b3ce9/index.html' denied

Does anybody have an idea what's causing this error?

 

The following R code has been used to create the visual:

source('./r_files/flatten_HTML.r')

############### Library Declarations ###############library(ggplot2)library(plotly)library(lubridate)
####################################################

################### Actual code ####################x <- data.frame(as.POSIXct(substr(Values$SendLocalTime,0,19),format = "%Y-%m-%dT%H:%M:%S"), as.numeric(as.character(sub(",", ".", Values$AvgBeltTemperature, fixed = TRUE))))colnames(x) <- c("Date", "Value")x <- data.frame(as.POSIXct(substr(Values$SendLocalTime,0,19),format = "%Y-%m-%dT%H:%M:%S"), 
                as.numeric(as.character(sub(",", ".", Values$AvgBeltTemperature, fixed = TRUE))),                as.numeric(as.character(sub(",", ".", Values$MinBeltTemperature, fixed = TRUE))),                as.numeric(as.character(sub(",", ".", Values$MaxBeltTemperature, fixed = TRUE))))colnames(x) <- c("Date", "Average","Minimum", "Maximum")

#Labels for axisf <- list(  family = "Arial, monospace",  size = 16,  color = "#7f7f7f"
)label_x <- list(  title = "Date",  titlefont = f)label_y <- list(  title = "Temperate (Celsius)",  titlefont = f)g<-plot_ly(x= ~x$Date, y = ~x$Average, type = 'scatter', name="Average", mode='markers') %>%  add_trace(x= ~x$Date, y = ~x$Minimum, name = 'Minimum', mode = 'markers') %>%  add_trace(x= ~x$Date, y = ~x$Maximum, name = 'Maximum', mode = 'markers') %>%  layout(title = "Temperature", xaxis = label_x, yaxis = label_y)

(gg <- ggplotly(g))internalSaveWidget(gg, 'out.html');
####################################################
  • I've received the solution from Microsoft support that worked for me.

     

    Simply remove the plot_ly conversion in the end:

     

    (gg <- ggplotly(g))

     

    and use 'g' as input for internalsavewidget because 'g' is already a plot_ly object.

    Not sure why this leads to an error in PowerBI service because converting a plot_ly object to a plot_ly object shouldn't be a issue.

7 Replies

  • v-huizhn-msft's avatar
    v-huizhn-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi chriswalz,

    In your statement, you use source('./r_files/flatten_HTML.r') to cite other R statement, please use the detailed R in the .r file statement to replace the "source('./r_files/flatten_HTML.r')", and check if it works fine. And please follow this blog to check if there is unsupported packages in your .r file.

    Best Regards,
    Angelia

    • chriswalz's avatar
      chriswalz
      Regular Visitor

      Hi v-huizhn-msft,

       

      thanks for your response - unfortunately they didn't solve this issue. Still getting the access denied runtime error. I also checked the packages but all packages i'm using are on the list of supported packages.

       

      Best regards,

      Chris

      • Jole's avatar
        Jole
        Frequent Visitor

        I experienced same issue. 

        Does any one know the solution?

         

        Thank you

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi chriswalz,

     

    I am having the same problem and the suggestion marked as the solution below does not work for me.

    Did you have your problem fixed?

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    I experienced same issue. 

    Does any one know the solution?

     

    Thank you