Last Updated on June 1, 2022 by Rakesh Gupta
👉 Check out this article if you want to learn how to Add Report Chart to Lightning Record Page
Reports and dashboards display how you performed in the past and what’s happening at the moment. They are important to driving success and implementation of any CRM project. The information provided by reports and dashboards is especially important in today’s arena, where it’s critical to be proactive, rather than reactive, in your approach. You want to be able to spot trends and act on them immediately.
Business Use case
Higher management in Universal Container wants to use Opportunity trends report chart on a Visualforce Page.
Automation Champion Approach (I-do):
You can use report Report Chart (That is created by using the report builder) in any Visualforce page, with only a single line of code. Report Chart can include dynamic filters, auto-refresh based on an expiration time, and many other options. With this enhancement, all of your most critical Chart and analytics is in the background, wherever you are working.
- Create a Report with Chart. If you don’t to how to do that please go through my article Embedding Charts Anywhere
- Copy the report ID, you can get a report’s ID from the report URL in Salesforce, or request it through the API.
- Now create a Visualforce page and use Visualforce tag <analytics:reportChart> with attribute reportID
<apex:page > <analytics:reportChart reportId="00Ox0000000i8gv" size="small"></analytics:reportChart> </apex:page>
- It will look like below screenshot
Points to Remember
- By default chart’s size is set to Medium. If you to change the size use size attribute and values you can use are Tiny, Small, Medium, Large, Huge.
- The length of time that an embedded chart can cache data is 24 hours.
I want to hear from you!
What is one thing you learned from this post? How do you envision applying this new knowledge in the real world? Feel free to share in the comments below.