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
Andrew Hoban 6Andrew Hoban 6 

Filter on anaytics:reportchart from an iframe using apex:tab

Hi all,

I have attempted to place an analytics:reportchart into my visualforce page inside apex:tab. After some research i found that this is currently not possible (https://help.salesforce.com/apex/HTViewSolution?id=000212701&language=en_US)

In the resolution, it says to create a visualforce page, place the chart inside then call it with an iframe. 

The issue I have here is that I need to placea filter on the report chart with the AccountID.  The report needs to be dynamic and apply for whatever the account is currently on.


Is there a way to place a filter on the report and call with an iframe?

Thanks
Andy BoettcherAndy Boettcher
You could pass the AccountId as part of the iFrame URL, then pull that in via ApexPages.currentPage().getParameters().get('id') in the iframed VF page.
Andrew Hoban 6Andrew Hoban 6
Thanks for the reply.

In the iFrame i have attempted to call the name of the report and the AccountId
 
<apex:iframe src="/apex/rightsTrackerReports&name='Accounts_by_Category_New'&id={!AccountId}"/>


In our controller we have a variable:
AccountId = ApexPages.CurrentPage().getParameters().get('Id');

Now, when I click on the click on the tab to open the iFrame I am getting the error message: The name can only contain underscores and alphanumeric characters. It must begin with a letter and be unique, and must not include spaces, end with an underscore, or contain two consecutive underscores

 
Andrew Hoban 6Andrew Hoban 6
Hi,


in my anaylitics:ReprtChart I have the following - <analytics:reportChart reportId="00Of0000000JdwT"  hideOnError="false" size="small" filter="[{column:'AccountId', operator:'equals', value:'{!AccountId}'}]"/> 

I am getting the error message inside the chart: [For the filter 1: Specify a valid filterable column because AccountId is invalid.]

I still have AccountId in my controller passing through the ID so im not sure what to do next.

Thanks