1

My requirement is to embed a report into a Custom visualforce page. For this I am using apex:iframe with 'src' parameter value set as relative url to the Report. However it does not give any error at compile time but at runtime it only displays a blank page. When I used firebug to inspect it shows "Refused to display 'https://....' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'."

Does anybody know solution for this problem? Or it will be really helpful if anybody provides alternate way to embed reports into visualforce page.

VisualForce page is:

<apex:page sidebar="false">
    <apex:iframe src="/00OW0000000FngF" scrolling="true"/>
</apex:page> 

Thanks, KP

  • Can you post your code? The VF page and the report should have the same origin so you shouldn't be getting that error. – BarCotter Nov 5 '14 at 10:27
  • @BarCotter My visualforce page has following content: <apex:page> <apex:iframe src='/reportId' scrolling='true'> </apex:iframe </apex:page> – user12873 Nov 5 '14 at 11:58
  • That is not a valid page. The iframe tag is not properly closed and you are hard coding the report URL to '/reportId' rather than '/' + {!reportId} (assuming you have a variable called reportId in the controller) – BarCotter Nov 5 '14 at 12:02
  • Thanks BarCotter! Updated Code is :- <apex:page sidebar="false"> <apex:iframe src="/00OW0000000FngF" scrolling="true"/> </apex:page> – user12873 Nov 5 '14 at 12:07
  • I have added that code to your question – BarCotter Nov 5 '14 at 12:10
1

SalesForce stopped supporting the displaying of reports in iFrames in Spring '14. They also introduced the Reporting API in this release. Try using the analytics:reportChart tag to display your report. Example:

<analytics:reportChart reportId="00OZ0000000I3rc"/>
  • Here is a code example on displaying reports – BarCotter Nov 5 '14 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.