CONTROLLER: public class Dashboard{ Public List tenpartners{get;set;} public String Name{get;set;} public Boolean rend { get; set; } public pagereference search(){ tenpartners = new List(); tenpartners = database.query('SELECT ID,CreatedDate,NumberofLeads__c,Name FROM Partner__c where =:Name ORDER BY NumberofLeads__c desc LIMIT 10'); return null; }} But problem I am facing is for 1st partner its showing correct report chart but for rest of the 9 charts its displaying the chart which is of 1st partner, here is the screenshot, so if you see twelthpartner which has highest number of leads i.e. 6 is ranked first but same chart is displayed for rest of the nine partners..... I have also created report and tried by creating passed filter and without any filter but no change... Anyone faced this problem or if they have any idea what happening here, will be a great favor..", "answerCount": 1, "upvoteCount": 0, "datePublished": "2015-06-02T23:03:59.000Z", "author": { "@type": "Person", "name": "Mamnoon Hadi", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000BMFWgAAP", "affiliation": { "@type": "Organization", "name": "--" } }, "suggestedAnswer": [ { "@type": "Answer", "text": "If anyone have any idea or need more clarification for this please let me know. I woul be very glad and obliged", "upvoteCount": 0, "url": "https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007T4DqtSAF", "datePublished": "2015-06-08T10:34:52.000Z", "author": { "@type": "Person", "name": "Mamnoon Hadi", "url": "https://trailblazers.salesforce.com/profileView?u=0053000000BMFWgAAP", "affiliation": { "@type": "Organization", "name": "--" } } } ] } } Skip to main content
Mamnoon Hadi a posé une question dans #Visualforce
Hello All,

I am facing a problem related to report chart in a Visual Force, Following is the objective:

1) For all the sales agents pull their top 10 Partners (who generated most leads) and display each partners last 12 months performance monthwise (showing bar chart how many leads are generated by each of those 10 partners)

So, I wrote following VF Page:

<apex:page controller="Dashboard" sidebar="false" >

<script>

function closeWindow(){

window.parent.close();

}

</script>

<apex:form ID="Search" >

  <apex:pageBlock >  

    <apex:pageMessages ></apex:pageMessages>

  <apex:pageBlockButtons >

   <apex:commandButton value="Submit" action="{!Search}" reRender="showpartner" />

   

    </apex:pageBlockButtons>

  <apex:outputLabel value="Name:" />

  <apex:inputText value="{!Name}"/>

  

  <apex:pageBlockTable value="{!tenpartners }" var="partnervalue" id="showpartner" >

  <apex:column value="{!partnervalue.name}"/>

  <Apex:column value="{!partnervalue.id}"/>

  <apex:column value="{!partnervalue.NumberofLeads__c}"/>

  <apex:column value="{!partnervalue.CreatedDate}"/>

   

<apex:column >

<analytics:reportChart cacheAge="10" cacheResults="false" reportid="00O240000027ckD" size="large" filter="{column:'Partner__c.Name', operator:'equals', value:'{!JSENCODE(partnervalue.Name)}'}">

</analytics:reportChart>

</apex:column>

  

  </apex:pageblockTable>

  

  

  

  </apex:pageBlock>

  </apex:form>

</apex:page>

CONTROLLER:

public class Dashboard{

Public List<Partner__c> tenpartners{get;set;}

public String Name{get;set;}

public Boolean rend { get; set; }

public pagereference search(){

tenpartners = new List<Partner__c>();

tenpartners = database.query('SELECT ID,CreatedDate,NumberofLeads__c,Name FROM Partner__c where Owner.Name=:Name ORDER BY NumberofLeads__c desc LIMIT 10');

return null;

}}

But problem I am facing is for 1st partner its showing correct report chart but for rest of the 9 charts its displaying the chart which is of 1st partner, here is the screenshot, so if you see twelthpartner which has highest number of leads i.e. 6 is ranked first but same chart is displayed for rest of the nine partners.....

Report chart in Visualforce page

I have also created report and tried by creating passed filter and without any filter but no change...

Anyone faced this problem or if they have any idea what happening here, will be a great favor..
1 réponse
  1. 8 juin 2015, 10:34
    If anyone have any idea or need more clarification for this please let me know. I woul be very glad and obliged
0/9000