You need to sign in to do that
Don't have an account?
Ivar@Marel
Dashboards in visualforce pages
Hi everyone.
Has anyone attempted to display a dashboard as part of a visualforce page? I have been browsing around and haven't found anything. The reason I ask is that I want to show one of our dashboards on our company's intranet websites, and figured the easiest way to do it would be to display it in visualforce and publish it as a Site that the intranet web could then incorporate into it's layout.
If anyone has any hints or tips I'm all ears :)
Regards,
Ivar
You can pull dashboards in to a visualforce via an iframe, but you will get the headers repeated. Another mechanism is to retrieve the dashboard programmatically (via generating a PageReference for the dashboard and the executing the getContent() method) and simply render the HTML fragment(s) that you are interested in.
All Answers
You can pull dashboards in to a visualforce via an iframe, but you will get the headers repeated. Another mechanism is to retrieve the dashboard programmatically (via generating a PageReference for the dashboard and the executing the getContent() method) and simply render the HTML fragment(s) that you are interested in.
nice tip... i was thinking of visualforce charts..
Thanks for the help Bob. That got me on the right track. I did a quick proof of concept / test that does exactly what I wanted. Thanks again :)
Below is the test's page and controller for anyone thinking about the same:
When I try your above code it throws me an error. Could you please help me.
Error: DashboardSnippetController Compile Error: line 6:104 no viable alternative at character '"' at line 6 column 104
public with sharing class DashboardSnippetController
{
public DashBoardSnippetController(){}
public string getDashboardHtml(){
PageReference dbPage = new PageReference('<a href="https://ap1.salesforce.com/01Z90000000Qy2K');" target="_blank" rel="nofollow">https://ap1.salesforce.com/01Z90000000Qy2K');</a> // Throwing error on this entire page reference line
Blob pageBlob = dbPage.getContent();
return pageBlob.toString();
}
}
}
Did you got solution for Problrm ???