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
ThousifAli99ThousifAli99 

apex:iframe auto redirecting to source URL

I have iframed a standard report in a visual force page as below 

<apex:page standardController="account" tabStyle="Account">
 <apex:iframe src="/00OK0000000dR7a?pv1={!Account.id}" scrolling="true" height="1588px" width="100%"/>
</apex:page>

The visual force page is embedded into Account detail page. When i open the detail page i get redirected to the standard report iframed in the page.
Does anybody know how to stop the auto redirect.
PratikPratik (Salesforce Developers) 
Hi,

will you please elaborate wheather you embeded the VF page in the account pagelayout or you are providing a custom link which in turn will open the report (VF page).

Thanks,
Pratik
ThousifAli99ThousifAli99
Pratik,

The VF page is embedded on the Account pagelayout

Thanks
Thousif Ali
PratikPratik (Salesforce Developers) 
Hi,

I tried your code above and also added the vf page on the account pagelayout. It's working fine.

Also if your report has only one filter (first filter) then try "pv0" instead of "pv1" inyour iframe code.

Thanks,
Pratik
 
ThousifAli99ThousifAli99
Hi,

Have you added any attributes to the iframe. becuase when i preview the visual force page i get the following error 

Load denied by X-Frame-Options: https://ap1.salesforce.com/00OK0000000dR7a does not permit cross-origin framing.

Thanks
Thousif
PratikPratik (Salesforce Developers) 
Hi Thousif,

Here is the code that i am using:


<apex:page standardController="account" tabStyle="Account"> <apex:iframe src="/00O900000067o5D?pv0={!Account.id}" scrolling="true" height="1588px" width="100%"/>
</apex:page>


I just changed the report id. I can see the vf page separately as well as in Account page layout. Is there any other code that you have added in your page?

Thanks,
Pratik
ThousifAli99ThousifAli99
No that is pretty much it. I believe there's something going on in backgoround..
ThousifAli99ThousifAli99
Pratik,

One more thing can you tell me if the clickjack protection for non-setup salesforce pages is enabled in your sandbox.
PratikPratik (Salesforce Developers) 
Hi Thousifa,

It's disabled. If it's enabled for you, disbale it by contacting Salesforce support. If clickjack protection is enabled for non setup pages, your report will not be shown in the iframe itself.

Thanks,
Pratik
Peter FranzenPeter Franzen
I'm also experiencing this problem.  I"m trying to display report results in an iFrame on the home page, but it always redirects the whole page to the report results rather than just displaying it.

Does anyone have a solution for this yet?