function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Anthony Gomez 14Anthony Gomez 14 

How do I embed a report onto a Visualforce page?

Hello, I know this question has been asked on here before and I've looked through people's answers but none of them have been able to help me so far.

I would like to display a graph from a report on a Visuaforce page.

 

Here is my code:
<apex:page >
<analytics:reportChart reportId="00O2D000000FJMu"/>
</apex:page>

This shows up when I'm looking at it in the Preview from the developer console. But as soon as I use the link for this VF page it just shows a blank page.

Thanks in advance for the help.

Tony

Benjamin_MitchellBenjamin_Mitchell
I know it seems really simple, but make sure there aren't any conflicting styles on the page that would stop it from appearing, such as a display: none;

Also make sure you're on API version 29.0+

I would give the hideOnError attribute a value of "false" just in case it's erroring for some reason, and you're just not seeing it.

More here: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_analytics_reportChart.htm?search_text=report
Anthony Gomez 14Anthony Gomez 14

Thanks Bemjamin.

I created a brand new VFP with nothing but this code to make sure there aren't any conflicting styles, made sure I was on an API version hgher than 29 (i tried 43, 42, and 39), included the hideOnError attribute and I'm still getting nothing unfortunately

Benjamin_MitchellBenjamin_Mitchell
Could it be because of permissions on the report?  I've been digging through the documentation/posts for the analytics:reportChart standard component reference, but I haven't seen much else.  Sorry.