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
Michael Hedrick 2Michael Hedrick 2 

Open VisualForce Report from Account Page Layout to new Window with filtered data

Hello All,
I have a simple VF page that opens a Chart on a Account Page Layout;

<apex:page standardController="Account">
<script type="text/javascript">
function Test(){
var url = '/00Oj0000004KjPM';
window.parent.location.replace(url);
}
</script>
<apex:outputLink onclick="Test();">
    <analytics:reportChart cacheResults="false" reportId="00Oj0000004KjPM"
        filter="{column:'FK_ACC_ID',operator:'equals',value:'{!Account.Id}'}"
        size="small">
    </analytics:reportChart>  
   </apex:outputLink>
</apex:page>

This works ok but I cannot get the report to open in a 'new' window and the report that does open is not filtered by the Account id.

Any thoughts or suggestions is alwys appreciated.

Regards,
M
Krzysztof NowackiKrzysztof Nowacki
In my code the iD is beeing passed by also can't open it in new window.

<analytics:reportChart reportId="00Ob0000003sJ0a" cacheResults="false" showRefreshButton="False" filter="{column:'ACCOUNT_ID', operator: 'equals', value: '{!Id}'}" ></analytics:reportChart>

 
RD@SFRD@SF
Hi Michael

Please set the target attribute in the apex:output link as "_blank"
 
<apex:outputLink onclick="Test();" target="_blank">

this tells the browser to open the link in the new tab, new window.

Hope it helps
RD

 
Michael Hedrick 2Michael Hedrick 2
Thank you.  I will give this a try.  Do you know if this will work in salesforce1?
Cheers,
M
Michael Hedrick 2Michael Hedrick 2
Still opening in section on page


<apex:page standardController="Account">
<script type="text/javascript">
function Test(){

}
</script>
<apex:outputLink onclick="Test();" target="_blank">
    <analytics:reportChart cacheResults="false" reportId="#############"
        filter="{column:'ACCOUNT_ID', operator: 'equals', value: '{!Id}'}"
        size="small">
    </analytics:reportChart>  
   </apex:outputLink>
</apex:page>