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
bujjibujji 

how to display a report in Visual force page

Hi guys,

 

Is it possinle to display a report in visula force page? if yes, can anybody tell me the steps to do it.

Help will be appreciated.

 

 

Thanks in Advance.........................

Best Answer chosen by Admin (Salesforce Developers) 
Navatar_DbSupNavatar_DbSup

Hi,

 

You can display the report in the Visual force page. You can pass the report id in the apex: iframe src.

Use the below code snippets as reference

<apex:page >

  <apex:iframe src="/00O900000020jcA"/>  <!—Red mark is Report id -->

</apex:page>

 

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

 

 

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

 

You can display the report in the Visual force page. You can pass the report id in the apex: iframe src.

Use the below code snippets as reference

<apex:page >

  <apex:iframe src="/00O900000020jcA"/>  <!—Red mark is Report id -->

</apex:page>

 

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

 

 

This was selected as the best answer
bujjibujji

Thanks Jain,

 

Yes i am able to get that report but salesforce header is coming can we remove it.

 

Andy BoettcherAndy Boettcher

In the <apex:page> tag, do this:

 

<apex:page showHeader="false" sidebar="false">

 

-Andy

Iridious JonesIridious Jones
How so you stop this page from loading the report in either a new window or overiding the current window/tab. For example. I've added the VF page to a case page layout. Shortly after the case loads, it takes the user to the report rather than display in a section on the case.
JeetSomJeetSom
Jones: Do you have professional edition? The same thing happens to me and I have PE.
Iridious JonesIridious Jones
Yes. Since I posted, the VF page actually stopped loading the report details. I added a custom link to open the report from the case rather than load the report on a VF page. Not as pretty but its a workaround for the time being. 
Sandra Rendel 7Sandra Rendel 7
Hi
I have also the same problem I added a report on VF and added it on home page
but it automatically recirects to the report page and doesn't show me the home page
Sunil Shah 8Sunil Shah 8
Thanks Navatar & Andy Boettcher for the answers as I also wanted to display reports in VF page.
Karleen MendozaKarleen Mendoza
@Navatar - I tried your solution, but when I put it onto the home page component, I get this error:
 
Error	Warning: The element type "div" should be terminated by the matching end-tag "</div>" in c__accounthierarchytree at line 71

Any ideas?