You need to sign in to do that
Don't have an account?
Use associated Account ID as Report Filter while embedding chart into VisualForce page
I need to insert a Report chart into a VisualForce page on a Custom Object named "Visit Preparation". Simple enough...
Where I'm struggling... I need to filter the Report's chart using the ID of the Account associated (via lookup relationship) with Visit Preparation Records.
I've created a field that pulls the associated Account's ID named "Salesforce_ID__c".
How do I filter the inserted Report Chart's data by the ID shown in the Salesforce_ID__c field?
Thanks in advance!
Where I'm struggling... I need to filter the Report's chart using the ID of the Account associated (via lookup relationship) with Visit Preparation Records.
I've created a field that pulls the associated Account's ID named "Salesforce_ID__c".
How do I filter the inserted Report Chart's data by the ID shown in the Salesforce_ID__c field?
Thanks in advance!
After giving up on using the ID as the filter, I decided to try filtering on the Account Name and Site fields.
Additionally, I updated the API Version associated with the Custom Controller used for my Visit Preparation Object.
Works like a charm!
All Answers
Looks like you want to have the URL which will run the report for the selected Account Id. Here are the steps, which I would recommend to get to that.
1. Run the report in Salesforce. Let us say the url is https://na1.salesforce.com/00O9000000abcde
2. From step 1, the report Id is 00O9000000abcde
3. On the report, create a filter saying Account Id equal to '' and save the report one more time. If already done with the filter creation, ignore this step
4. Add the following attributes at the end of the url. "?pvo={!Salesforce_ID__c}'. The url becomes https://na1.salesforce.com/00O9000000abcde?pvo={!Salesforce_ID__c}
You need use the url from step 4 for displaying the report output in Visual force page.
Note: If this is helpful, please mark the question as answered so others can benefit too.
This would be useful while trying to display the whole Report. All I'm looking to do is show the Report's chart. Currently, I'm using the following code to show it:
Now, I need to filter it's results to only show data pertaining to the associated Account.
I've gone down the path of trying to add filters via:
but I keep getting an error that reads: [For the filter 1: Specify a valid filterable column because Account_ID is invalid.]
Thanks for taking a look anyway!
Here's what I've done.
- Created a text formula field that populates the Account ID on Cases named "Account_SFID__c"
- Created a text formula field that populates the Account ID on Visit Preparation Records
- Updated the custom controller you helped me with as follows:
- Created a Custom Report for Accounts and Cases containing both a "SFDC_ID__c" field (from Accounts) and an "Account_SFID__c" field (from Cases)
- The Report has a single finter of "Account SFID = "" "
The most recent code I've tried (on the Visit Preparation VF page) is:
column:'Account_SFID__c' references the Report column that's to be filtered.
value:'{Salesforce__ID__c} is to reference the Visit Preparation Record's text formula field that produced the associated Account's ID.
After giving up on using the ID as the filter, I decided to try filtering on the Account Name and Site fields.
Additionally, I updated the API Version associated with the Custom Controller used for my Visit Preparation Object.
Works like a charm!
I need to display funnel chart in account detail page, based on opportunity stages under particular account. I created one formula filed on opportunity say "accounid__C",it has accouont id of that opportunity. I created one summary report on opprotunity with filter condition and added funnel chart .Then Created visual force page to display chart. I am getting chart ,when I am not using any filter conditions. If am using filter condition I am getting error [For the filter 1: Specify a valid filterable column because Accounid__c is invalid.]
I am showing my code :
<apex:page controller="oppcontroller">
<analytics:reportChart reportId="00O90000006iiNQ" filter="[{column:'Accounid__c', operator:'equals', value:'{accid}'}]">
</analytics:reportChart>
</apex:page>
public class oppcontroller
{
public id accid{set;get;}
Public oppcontroller()
{
accid=ApexPages.currentPage().getParameters().get('id');
}
}
Please guide me in ordre to display chart with filter conditions in vf pages
You need to be very particular while creating the filter condition, need to maintain the right format.
Did you check to see if the Column API name is captured properly ? I have provided an example below.
filter="{column:'Custom_Object__c.Account__c.Name', operator:'equals', value:'{!Account.Name}'}"
Gives me:
Error: Unknown component analytics:reportChart
???
For a custom report it appears the name of the ID column in the report becomes CUST_ID. If you are looking for the standard Name column for instance, that column on the report becomes CUST_NAME for instance. Your mileage may vary, so again....use the Force.com IDE to pull down your report meta-data definition and take a look at the column specifications. Hope this helps!
How can we use a dynamic report id in <analytics:reportChart> instead of hardcoding it everytime.
Like putting <analytics:reportChart> inside a repeat tag.
I am having a problem in which the Ids are changing but on the page its repeating the report of the first chart only.
Anyone got that issue?
Year and month selected by user the graph should display.
Here's my report and chart. Id is just a detail column. No filters, standard Accounts report type. I have person accounts on here but doesn't really matter
My goal was to embed it as a mobile card on SF1
I was able to filter on ID using this code in the Vf page:
Works like a charm as either an embedded Vf page or a mobile card:
Hopefully that helps somebody else
Above code give the Error:
This developer name is invalid. Provide the developer name for the report that contains the chart.
How to achieve this?