0

I currently am using apex:reportChart to create a visual force page that will contain links to multiple reports. I have about 10 report charts that I would like to display. Right now, when clicking on a given chart, you are redirected to the related salesforce report.

However, when adding this page, to say the Home page as a component, the embedded VF page is redirected, and not the parent window. Below has some example code and image: enter image description here

<apex:page >
<apex:panelGrid columns="5" id="theGrid">

    <apex:outputLink onclick="window.parent.location.href = https://ex.my.salesforce.com/00Oo0000005gTOz">
        <analytics:reportChart reportId="00Oo0000005gTOz"  size="small" cacheResults="true"></analytics:reportChart>
    </apex:outputLink>   

    <apex:outputLink onclick="window.parent.location.href = https://ex.my.salesforce.com/00Oo0000005gMdW">
        <analytics:reportChart reportId="00Oo0000005gMdW"  size="small" cacheResults="true"></analytics:reportChart> 
    </apex:outputLink>

    <apex:outputLink onclick="window.parent.location.href = https://ex.my.salesforce.com/00Oo0000005gMcJ">
        <analytics:reportChart reportId="00Oo0000005gMcJ" size="small" cacheResults="true"></analytics:reportChart>
    </apex:outputLink>  

</apex:panelGrid>
</apex:page>

Any ideas on how to go about this?

0

You need to wrap the url in single quotes. I would also simply set window.top.location.

<apex:page>
    <apex:outputLink onclick="window.top.location = 'http://www.google.com'">
        <analytics:reportChart ... />
    </apex:outputLink>
</apex:page>

Dropping the quotes from the above is the only way I was able to reproduce the behavior you have observed.

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.