Sign up ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I have a few reports embedded in visualforce page using iFrame. Due to this new release of Spring '14, iFrame has stopped working and now these visualforce pages show blank screens. Can anyone help me with a work around?

share|improve this question
Could it be the clickjacking protection that they force enabled recently ( and being different domains)? What exactly does not work, have you checked the browser's console? –  eyescream Apr 17 '14 at 19:39
its not clickjacking. ALthough it wasn't recommended, i still disabled clickjack protection and tried to run it. It didn't work even then. –  Sam Apr 18 '14 at 6:35

2 Answers 2

up vote 3 down vote accepted

I just figured out a way to do this without an iFrame using jQuery.

First you need to include jQuery at the top of your VF page:

<script src=""></script>

Then include a target element in your page that will be the container for the report. For example:

<apex:pageBlockSection title="My Report" id="MyReport" columns="1" />

Now at the bottom of the page, use the jQuery load method to grab the HTML source of the report page, pull out just the report table, and inject it into the container:

<script language="JavaScript">
    $('[id$="MyReport"] > .pbSubsection > .detailList').load('/00Oi000000wxyz?pv0={!}&isdtp=nv table.reportTable.matrixReportTable');

Unfortunately the styling is lost, so I had to create a simple style sheet on the page to make it more readable:

<style type="text/css">
    [id$="MyReport"] > .pbSubsection {
    [id$="MyReport"] >.pbSubsection tr:first-of-type td, [id$="MyReport"] >.pbSubsection tr:first-of-type th {
        border-top:1px solid rgb(212, 218, 220)!important;
    [id$="MyReport"] > .pbSubsection th, [id$="MyReport"] > .pbSubsection td {
        font-size: 12px;
        padding:3px 6px 3px 5px;
        border-color:rgb(212, 218, 220)!important;
        border-bottom:1px solid rgb(212, 218, 220)!important;
    [id$="MyReport"] > .pbSubsection th {
    [id$="MyReport"] > .pbSubsection .grandTotal {
        background-color:rgb(212, 218, 220);
    [id$="MyReport"] > .pbSubsection .drilldown {
share|improve this answer
Wow! that must have took some serious effort but good job Dave! Thanks for the response :) –  Sam Aug 12 at 6:25

With Spring '14, Salesforce has really picked up the pace when it comes to their Analytics.

The Analytics API is now available in Apex.

Salesforce has also added a new tag, <analytics:reportChart> for embedding report data into Visualforce pages. As of right now, there is only one Visualforce component available in the analytics namespace, but my guess would be that more will be coming.

If you are trying to add this report to a page layout section, Salesforce has also recently added the ability to embed report charts in page layouts directly. This completely eliminates the Visualforce requirement!

Anyway, I would highly suggest looking into the Analytics API more. This should work a bit better than an iFrame for you. Peter Knolle has written some exceptional articles on the topic as well:

He also did a session at my local user group meetup that he recorded and put up on Youtube.

share|improve this answer
That is some very helpful information Jesse. But i tried <analytics:reportCharts> component. My reports do not have charts. And this component shows only tyhe chart part of the report. So this didn't work for me. Thanks for your response though :) –  Sam Apr 17 '14 at 13:27
I was afraid of that. As you noted, unfortunately this doesn't pull in the entire report, only the chart. –  Jesse Altman Apr 17 '14 at 13:35
Yeah! Actually I'm accessing these visual force pages through a custom link. Click on the link, and voila! a report 'used to' open. but nothing now :( –  Sam Apr 17 '14 at 13:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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