Dashboard – Loading a Dashboard in an iFrame Without Duplicating the XMPro Menu

How Can We Help?

Dashboard – Loading a Dashboard in an iFrame Without Duplicating the XMPro Menu

< Back

Scenario:

Often there will be scenarios where we want to embed XMPro dashboard into an XMPro activity. We can achieve this by adding a reference label in XMPro activity and binding the reference label with custom HTML. We can bind the reference label with an iframe control and set the iframe src attribute to the required dashboard.

Example:

If the dashboard Id is 3 then we can set the reference label as follows:

activity.SetControlValue("<reference label id>",
"<iframe src='<xmpro_site_url>/main.aspx?page=<xmpro_site_url>/
dashboardviewer.aspx%3Fid%3d3'frameborder='no' width='100%' height='850px'></iframe>");

If we look at the above sample code: we are setting the reference label control with an iframe and setting the iframe src attribute to the dashboard.

When we open the form in XMPro action console, we can see the dashboard loaded but we can also see two XMPro Action Console toolbars as shown below:

 

 

To hide the duplicate toolbar we need to adjust the custom HTML and append i=false in iframe src URL as shown below:

activity.SetControlValue("<reference label id>", 
"<iframe src='<xmpro_site_url>/main.aspx?page=<xmpro_site_url>/dashboardviewer.aspx%3Fid%3D3%26i%3Dfalse'
'frameborder = 'no'  width='100%' height='850px'></iframe>");

The HTML URL is encoded with %3F for ‘?’ , %3D for ‘=’ , %26 for ‘&’

When the form is opened in the Action Console, the dashboard is now loaded without the duplicate menu.

 

 

 

Comments are closed.

This is the legacy version of the XMPro Documentation site. For the latest XMPro documentation, please visit documentation.xmpro.com

X