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
anitha12anitha12 

How to combine VF Page Filter and Standard Reports

Hi I have created a standard report and created a vf page filter. when I am combining both, with pagerefrence it is redirecting to the stanrd report.But it should get filtered with in the Vf page. can any one pls help me urgent.

MY Controller:
public class Newfcntrl{
    public string locid{get;set;}
    public map<Id,String> locmap= new map<Id,String>();
   
    public List<SelectOption> getAvailableLocations() {
        List<SelectOption> Opts = new List<SelectOption>();
        for (Location__c  l : [Select Id, Name From Location__c limit 1000]){
            Opts.add(new SelectOption(l.Id, l.Name));
            locmap.put(l.Id, l.Name);
        }
        return Opts;
    }

    public pagereference showrep(){
        pagereference p = new pagereference('/00O90000007mGeE?pv0='+ locmap.get(locid));
        system.debug('p-----'+p);
        p.setRedirect(true);
        return p;
    }

}


My page:

<apex:page controller="Newfcntrl" sidebar="false" showHeader="false">
<apex:form id="theForm">
<apex:actionFunction name="testAF" action="{!showrep}" rerender="panid"/>
Location :<apex:selectList value="{!locid}" multiselect="false" size="1" onChange="testAF();">
            <apex:selectOptions value="{!AvailableLocations}" />
            </apex:selectList>
            <apex:outputPanel id="panid">
           <analytics:reportChart reportId="00O90000007mGeE"></analytics:reportChart>
           </apex:outputPanel>
</apex:form>
</apex:page>
bob_buzzardbob_buzzard
You shouldn't have the rerender on the apex:actionfunction, as that tells VF to remain on the same page and try to update part of the page with the response.

If you take that off, what URL do you get redirected to (i.e. does it contain your pv0 parameter or not).