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
KshitijKshitij 

Problem with new VF tag "analytics:reportChart"

For one of my requirement, I have to show two Funnel Charts on page with salesforce reports as source of data. As Funnel Charts can't be done using Google Chart or any other Free JS Library, I had to use the new feature i.e. new VF tag "analytics:reportChart". 

The issue I am having is whenever my page loads, my first chart loads and then once the second chart starts loading, the page refreshes completely. This happens most of the time.  Is there any solution for this? Please find below my VF page code. I am reRendering my outputpanel with an actionfunction tag.


<apex:outputPanel id="reportBlock" layout="block" style="width:100%;">
<div style="float:left;width:48%;">
        <div style="width:485px;margin:auto;">
            <analytics:reportChart reportId="00OQ0000000Pgol" showRefreshButton="false" cacheResults="true"
            filter="{!businessLineFilters}"/>
        </div>
    </div>
    <div style="float:right;width:48%;">
        <div style="width:485px;margin:auto;">
            <analytics:reportChart reportId="00OQ0000000Pgol" showRefreshButton="false" cacheResults="true"/>
            <!--filter="[{column:'BucketField_99085880', operator:'equals', value:'Debit'}]"-->
        </div>
    </div>
</apex:outputPanel >
Best Answer chosen by Kshitij
KshitijKshitij
I just got reply from Salesforce Support team. They are saying that this is a known issue now. It can be accessed using below URL. I guess now we can get it resolved within few days. 

https://success.salesforce.com/issues_view?id=a1p30000000T45IAAS

All Answers

VikashVikash (Salesforce Developers) 
Hi,
Please don't cache the first chart, try to load  both charts at a time.

Try this code
<apex:form>
<apex:actionFunction name="render"  rerender="false">
  <apex:outputPanel id="reportBlock" layout="block" style="width:100%;">
<div style="float:left;width:48%;">
        <div style="width:485px;margin:auto;">
            <analytics:reportChart reportId="00OQ0000000Pgol" showRefreshButton="false" cacheResults="false"
            filter="{!businessLineFilters}"/>
        </div>
    </div>
    <div style="float:right;width:48%;">
        <div style="width:485px;margin:auto;">
            <analytics:reportChart reportId="00OQ0000000Pgol" showRefreshButton="false" cacheResults="true"/>
            <!--filter="[{column:'BucketField_99085880', operator:'equals', value:'Debit'}]"-->
        </div>
    </div>
</apex:outputPanel >
</apex:actionFunction>
</apex:form>
Hopefully, this code will work.

Thanks
Vikash_SFDC
KshitijKshitij
Thanks Vikash for the solution, but unfortunately it is not working. By putting the whole code inside "Action:function" tag gives a Javascript error. This might be because "analytics:reportChart" itself generates its own <Script> tag. I also tried putting the action:function at different locations. I tried the suggestion for "caseResults" as well. Thanks again.
VikashVikash (Salesforce Developers) 
Hi Zenith,
I was using the tag "Action:Function" to use rerender function, the logic I was trying to implement is to not allow the page to refresh until both the charts get loaded. Hve you consumed the WSDL or not?, while loading the second chart the page hits the timeout and throws the error.

Thanks
Vikash_SFDC
KshitijKshitij
Hi,

I am not sure what do you meant by consuming WSDL. I am using this tag on my Visualforce page only with normal apex controller. I tried with putting Action:function at different locations in the page. 
Also, one thing I noticed, I am not getting any JavaScript error in Chrome and Firefox. But in Internet Explorer 8 I am getting a JS error saying "Aura has already been initialized". 

Thanks,
Kshitij Lawate
Venkatesh SatyamoorthyVenkatesh Satyamoorthy
Hi,

We are also facing the same problem where the page refreshes several times while the analytics reports is being loaded. We had couple of reports in the page and it used to sometimes refresh update to 4 times. As long as we have just one chart in the page there is no page refresh. As soon as i enable the second chart it refreshes. Any thoughts to understand if there was a solution to this problem will be useful.

Regards,
Venkatesh S
KshitijKshitij
I had raised a case with salesforce for this issue. Just got a call from them saying that it was a known issue and now it is resolved. I checked the same on my pages and it seems that it is resolved. Anybody reading this text if had this issue, can you please test again and post it here so that it will help me also to come to a conclusion that it is resolved. Thanks.
Big EarsBig Ears
Kshitij,

Unfortunately, this issue is not resolved for us. What information did you give to Salesforce in order to get them to raise it as a known issue?

Andy
KshitijKshitij
I had provided them few lines of my visualforce code where I am using this tag. I am not sure if they have looked into it, but now I have provided them access to login to sandbox. 
This issue seems to be intermittant for me. The earlier day (23 April) it was working perfectly fine and since yesterday it again has started showing the problem. Whenever I open my visualforce page it continues to refresh.
I guess by now salesoforce people might be knowing about this problem and they might be working on it. I will update this post whenever I get any reply from salesforce support.
Big EarsBig Ears
Thanks! Any update would be hugely appreciated. Salesforce Support are refusing to provide any info on this, even though it's a bug, rather than a development support question.
suraj vermasuraj verma
Hi we are also facing this issue.When i try to include this tag the page reloads continously until the data is displayed in the report chart.We are also using this tag in our project code but unfortunately nothing is happening and we are stucked.Any help or any workaround will be beneficial.
@Big Ears do you know any workaround for this issue ?
Big EarsBig Ears
Unfortunately not. I'm following up with my Account Executive to see if I can get some information on this.....
Mrinal ShawMrinal Shaw
I am facing if not the same issue a similar issue.The VF page spins on initial reload and upon refresh.  I keep getting an annoying firefox message stating the "page need to resend data".


My code below, super simple for POC, need to put more complex filtering:

<apex:page standardController="Account" extensions="AnalyticsController">
     <analytics:reportChart reportId="00OG0000006hOxY" size="small" filter="{!chartFilter}" cacheResults="true" />
</apex:page>
public with sharing class AnalyticsController{

  
    private final Account acct;
   
    public AnalyticsController(ApexPages.StandardController stdController) {
       
        this.acct = (Account)stdController.getRecord();        
    }


    public String getChartFilter() {
        return JSON.serialize(getSelectedFilters());
    }

    private List<ColumnFilter> getSelectedFilters() {
        List<ColumnFilter> columnFilters = new List<ColumnFilter>();
        columnFilters.add(new ColumnFilter('Account.Id','equals', String.valueof(this.acct.Id)));
      
        return columnFilters;
    }

    public class ColumnFilter {
        public ColumnFilter(String col, String oper, String val) {
            column = col;
            operator = oper;
            value = val;
        }

        // Values needed for apex:analytics component
        public String column { get; set; }
        public String operator { get; set; }
        public String value { get; set; }


    }
}
KshitijKshitij
Has anybody got any update on this issue. The refreshing of pages continues.
I do not have any update on this. Thanks in advance.
Big EarsBig Ears
My Account executive pointed me back to these boards for support, which was a little frustrating. No answers here, yet
KshitijKshitij
I just got reply from Salesforce Support team. They are saying that this is a known issue now. It can be accessed using below URL. I guess now we can get it resolved within few days. 

https://success.salesforce.com/issues_view?id=a1p30000000T45IAAS

This was selected as the best answer
Big EarsBig Ears
That's great, thanks Kshitij! I've posted this link on the other threads mentioning this issue.
Big EarsBig Ears
This fix looks to have been released now. You might want to close this off by selecting your link to the Known Issue as a Best Answer?
Eschel HamelEschel Hamel
Has anyone noticed a return of this problem?  I've found my charts that started behaving properly after patch 22 started misbehaving again perhaps with a more recent patch.
Big EarsBig Ears
Eschel,

I've not seen this in our EU0 org, but I'll keep an eye out, in case there's a rolling update going out that hasn't hit our systems yet. What instance are you on?