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
Patrick NylenPatrick Nylen 

Filter by Case Owner on analytics:reportChart

Hello,

I'm building a series of department dashboards using VIsualforce pages and the <analytics:reportChart> element.

How do I inline filter my report by Case Owner? My assumption is below, and I've tried several variations. We do not use queues/escalation rules, so I'm hoping that simplifies things.

<analytics:reportChart reportId="[Report ID]" filter="{column:'Case.Owner', operator:'equals', value:'[Name 1],[Name 2],[etc.]'}"></analytics:reportChart>

Thanks for taking a look ^_^
Best Answer chosen by Patrick Nylen
Nethaji BaskarNethaji Baskar
@ Patrick,
The Column Name for the Filter attribute in <analytics:reportChart> element should be the API Name from the report Metadata.
The Report Metadata can be accessed from the Analytics API.

Step 1: Open Salesforce workbench (http:// https://workbench.developerforce.com/
Step 2: Open REST Explorer in Uitilities Tab
Step 3: Click 'GET' REST method and give the below URL /services/data/v29.0/analytics/reports/00OD0000001ZbNHMA0/describe 
Note: Replace the Report Id with your report ID.
Step 4 : After clicking Execute get the Fields API Names from the 'reportMetadata' folder or from the correspoding grouping folders based on the type of report.
Step 5:  Use the Filed API Name (in this case 'OWNER') from report metadata as column in the 'filter' attribute of <analytics:reportChart>  element.
User-added image


Example: (Add your Report ID and User Name for Owner value for the striked out values below)
<apex:page standardController="Case">
    <analytics:reportChart cacheResults="false" reportId="00OD0000001ZbNHMA0"
        filter="[{column:'OWNER',operator:'equals',value:'Nethaji Baskar'}]"
        size="tiny">
    </analytics:reportChart>
</apex:page>

Refer: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_analytics_reportChart.htm

Good Luck!

- Nethaji