You need to sign in to do that
Don't have an account?
goabhigo
Opening report in new tab/window in Analytics reportChart
Hi all,
I have created a VF page with couple of reports. These reports are filtered, based on the selection available. For now assume the filter is just the Owner Name. All works well - I have used to show the report chart and have used cacheResults="false" to ensure the reports get refreshed on load.
Now coming to the issue I am facing - when the user clicks on the report chart the report opens in existing window/tab. I want it to be opened in new tab/window. I have tried using onclick() and < a >tag, but no luck.
Can anybody suggest if there is a way to do this?
Here is the very sample code - without filters - just a simple page with report chart.
Interestingly the block becomes clickable and opens in new tab. Please note that including the filters in doesn't work for some reports. So I guess this is not the solution. Also note that there is no attributes available in reportChart to open this in new tab.
Please suggest.
I have created a VF page with couple of reports. These reports are filtered, based on the selection available. For now assume the filter is just the Owner Name. All works well - I have used to show the report chart and have used cacheResults="false" to ensure the reports get refreshed on load.
Now coming to the issue I am facing - when the user clicks on the report chart the report opens in existing window/tab. I want it to be opened in new tab/window. I have tried using onclick() and < a >tag, but no luck.
Can anybody suggest if there is a way to do this?
Here is the very sample code - without filters - just a simple page with report chart.
<apex:page> <a href='/00ON0000000LRNi' target='_blank'> <analytics:reportChart reportId="00ON0000000LRNi"></analytics:reportChart> </a> </apex:page>
Interestingly the block becomes clickable and opens in new tab. Please note that including the filters in doesn't work for some reports. So I guess this is not the solution. Also note that there is no attributes available in reportChart to open this in new tab.
Please suggest.
Try something like this and let me know if it worked.
Am sorry for the miss but can you try this one.
<apex:page >
<script type="text/javascript">
function Test(){
var url = 'https://ap1.salesforce.com/00O90000009B17M';
window.open(url,'_blank');
//window.parent.location.replace(url);
}
</script>
<apex:outputLink onclick="Test();">
<analytics:reportChart reportId="00O90000009B17M"></analytics:reportChart>
</apex:outputLink>
</apex:page>
I have tried this in my Org and on click report opens in new tab.
- The report opens in both the tabs
- Mainly, the chart filters needs to be recreated or rather passed as parameter. Report filters do not work with url parameters in custom fields.
When the filters are already fetched and applied on report, the simple solution should be onlcik of the chart it opens in the new tab. Sadly Salesforce doesn't provide this. Probably after introducing this tag they were occupied in Analytics Cloud/Wave rather than imprving this tag :(--
Abhi
<a href="https://sogetikellanscheiber-dev-ed.my.salesforce.com/00O610000045q1f" target="_blank" cacheResults="false">Open Reservation Report</a>
<apex:outputPanel >
<analytics:reportChart reportId="00O610000045q1f" showRefreshButton="true" size="huge" cacheResults="false"/>
</apex:outputPanel>
</apex:pageBlock>