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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
amassip
Helper I
Helper I

Custom visual open new report

Hello everybody

 

I want to know if it is possible to open a new powerBI report when the user clicked on a custom visual ?

 

 

var elements = document.getElementsByClassName("class");
			for(var x=0; x<elements.length; x++)
			{
			  elements[x].addEventListener("click", function(e) {
				window.top.location.href = url;
			  });
			} 

I got the following error :

 

Refused to display 'https://myurl.com/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

 

So I know the header depends of the owner but I wonder if I missed something else ?

 

Thanks

 

 

 

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@amassip,

 

So far, I do not find an available way. You may submit an idea.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I am able to display hyperlink with this code:

 

'<a onclick=parent.postMessage("childframe","*");> '+ click here +' </a>'

 

But when i click on 'click here' it doesn't transfer the message even if the event is reached

 

window.addEventListener("message", function (event) {
   console.log(event.data); //display data but not the parameter
});

 

Update

 

With this 

 

'<a onclick=window.postMessage("childframe","*");> '+ task.typeDate.type+' </a>'

And this code :

 

// Create IE + others compatible event handler
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
var eventer = window[eventMethod];
var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";

// Listen to message from child window
eventer(messageEvent, function (e) {
    console.log('parent received message!:  ', e.data);
}, false);

I can see my parameter but the origin source is unknwon so it is not safe at all

@amassip,

 

You could also reach out for help on GitHub and keep an eye on Custom Visuals blog for the latest info.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.