Create Visualforce Dashboard Components
Use Visualforce pages as dashboard components. A dashboard shows data
from source reports as visual components, such as charts, gauges, tables, metrics, or
Visualforce pages. The components provide a snapshot of key metrics and performance
indicators. Each dashboard can have up to 20 components.
Available in: Salesforce Classic (not available in all orgs) |
Available in: all editions |
-
Create a Visualforce page called VFDashboard.
The Visualforce page uses a standard list controller, so you can add it to a dashboard. It displays a list of the cases associated with your org.
<apex:page standardController="Case" recordSetvar="cases"> <apex:pageBlock> <apex:form id="theForm"> <apex:panelGrid columns="2"> <apex:outputLabel value="View:"/> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="list"/> <apex:selectOptions value="{!listviewoptions}"/> </apex:selectList> </apex:panelGrid> <apex:pageBlockSection> <apex:dataList var="c" value="{!cases}" id="list"> {!c.subject} </apex:dataList> </apex:pageBlockSection> </apex:form> </apex:pageBlock> </apex:page>
- Build a Salesforce Classic dashboard.
-
Add the Visualforce page to a dashboard.
- Click the Dashboards tab.
- On the dashboard where you want to add the Visualforce page component, click Edit.
- From the Components tab, drag Visualforce Page onto your dashboard.
- From the Data Sources tab, click the Visualforce Pages dropdown, and drag VFDashboard onto the component that you just added to the dashboard.
- Optionally, enter a header or footer to display on the Visualforce dashboard component.
- Save your changes.
For a more complex example that uses a custom list controller, see Create Advanced Visualforce Dashboard Components.