Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello!
I'm just starting to learn about custom visuals and R-scripting in Power BI.
I have created a very simple animation using plotly which works fine in Power BI desktop.
However, when I try to publish the report I get an error saying
access to 'C:\Users\Client\Temp\RtmpM1YfAz\viewhtml1c546e16cc/index.html' denied.
Entier error can be seen in the picture below:
R version used: 4.2.1
Plotly version used: 4.10.0
ggplot2 version used: 3.3.6
Here is the script used for the custom visual:
source('./r_files/flatten_HTML.r')
############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly")
####################################################
################### Actual code ####################
library(plotly)
df <- data.frame(
x = c(1,2,1),
y = c(1,2,1),
f = c(1,2,3)
)
fig <- df %>%
plot_ly(
x = ~x,
y = ~y,
frame = ~f,
type = 'scatter',
mode = 'markers',
showlegend = F
)
fig
####################################################
############# Create and save widget ###############
p = ggplotly(fig);
internalSaveWidget(p, 'out.html');
####################################################
################ Reduce paddings ###################
ReadFullFileReplaceString('out.html', 'out.html', ',"padding":[0-9]*,', ',"padding":0,')
####################################################
Any help in resolving this issue would be much appreciated.
Thanks!
Hi @MartinSlaa,
When developing locally, R visuals will use the instance of R on your machine. As such, this will be able to resolve a file path that exists on your file system.
When you use an R visual in the Service, Power BI delegates the execution to a separate instance hosted by MS. As such, this will not know about your machine, or the files on it.
If you want to access an external file, you will need to host this in a location that can be accessed over HTTP, with no CORS restrictions (as custom visuals are hosted in sandboxed iframes and have their origin removed by the main window for security reasons).
Hopefully some of this may help you diagnose the issue and resolve.
Daniel
Proud to be a Super User!
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)