I want top display dashboard in VF page.
When I am trying to do it using blank window appear.
<apex:iframe src="/01Z28000000Hdzo" >
Right now I am doing as per follows.
Page -
<script language='javascript'> {!dashboardBlob} </script>
Controller -
public string getdashboardBlob() { PageReference dbPage = new PageReference('/01Z28000000Hdzo'); Blob pageBlob = dbPage.getContent(); return pageBlob.toString() }
Using above Dashboard is loaded into page but when I am trying to refresh the dashboard by clicking Refresh button (Standard button present on Dashboard) it gives me Access Control Origin error.
"XMLHttpRequest cannot load https://ap2.salesforce.com/dash/dashboardRefresh.apexp. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://c.ap2.visual.force.com' is therefore not allowed access."
Please suggest if you have any solution for this.