Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
chriswalz
Regular Visitor

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');
####################################################
1 ACCEPTED SOLUTION

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.

View solution in original post

7 REPLIES 7
gomezepor
New Member

I experienced same issue. 

Does any one know the solution?

 

Thank you

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?

 

v-huizhn-msft
Employee
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

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

I experienced same issue. 

Does any one know the solution?

 

Thank you

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.

I experienced same issue. 

Does any one know the solution?

 

Thank you

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors