+ Start a Discussion

Filtered Dashboards on Home Tab?

Hi everyone.


Has anyone used Visualforce to add a new Dashboard component to the Home tab? I found some assistance on this post: http://boards.developerforce.com/t5/Visualforce-Development/Dashboards-in-visualforce-pages/m-p/350171


and I've borrowed that code, but the filter does not appear on the Home tab. Obviously there are some other parameters that I'm missing. Any suggestions?









 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).


If want to create a link on the home tab for creating a new dashboard. You can create a custom link by following the below steps:


Setup->customize->home-> click on home page component->click on Edit link present in Custom Links

Enter the 1.Bookmark= create dashboard and URl= /00O/o

Click on save button.


After creating the custom link you have to add the custom link component on the home page layout

Setup->customize->home-> click on Home Page Layouts->click on Edit link of the page layout->check the check box of the Custom Links->click on next button->click on save and assign button


Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 





Thanks for the reply, but what I'm trying to do is show a filtered dashboard and the filter as a component on my Home tab.  Using the following code, I get the dashboard (but with the headers like you mention), but it does not include the filter. Any more help would be great.



public with sharing class DBSnippetController {
public DBSnippetController(){}

public string getDashboardHtml(){
PageReference dbPage = new PageReference('https://cs3.salesforce.com/01Z800000013Rxf');
Blob pageBlob = dbPage.getContent();
return pageBlob.toString();


VF Page:

<apex:page controller="DBSnippetController" showheader="false" sidebar="false">
<div id="mainArea">

document.getElementById('mainArea').innerHTML = '{!dashboardHtml}';


Home Page Component:

<br><iframe src="/apex/db_component?core.apexpages.devmode.url=1" width="1000px" height="400px"></iframe><br>