• Alex Ohadi
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hello,

I've been gettign an error when I try to filter the reports by state. It says its in the incorrect JSON format, which doesnt make sense because I have it in the right format. I am trying to put it into the correct JSON format by making a call to the controller like so...

<analytics:reportChart  reportId="{!reportbusinessId}" filter="{!chartFilter}" size="tiny" />

the chart filter is like this in the controller ..

 public String getChartFilter() {
     
   string CF = '[{column:State/Province,operator:'+this.Operator+',value:' + this.stateChoice +'}]';
       
// I dont know how to call the return because both of these return values below fail.
//return JSON.serialize(CF);
// return CF;
  }


How do I get the correct JSON Filter?
   
Hello,

I am trying to create a report on a APEX page that will preview the selected report that the user picks.

I almost have the code down! I need help with returning the correct report ID!

I wrote my code in a component.


Component Code:

<apex:component controller="Reports_ARO">

   
    <apex:form >
        <apex:selectList value="{!reportname}" size="1" >
            <apex:selectOptions value="{!reportOptions}" />
            <apex:actionSupport event="onchange" rerender="feed"/>
        </apex:selectList>
    </apex:form>
   
  
    <apex:outputPanel id="feed" layout="block"  style="overflow:auto;pointer-events:auto;width:300px;height:195px" >
       
       <analytics:reportChart size="tiny" reportId="{! reportid}"></analytics:reportChart>
        
    </apex:outputPanel>
        
     
</apex:component>

Controller

global class Reports_ARO {

    global String reportName { get; set; }

    global ID reportId;


  
   
   
    global static List<SelectOption> getreportOptions() {
        List<SelectOption> options = new List<SelectOption>(8);
       
        // Adds a blank option to display when the page loads.
       
        options.add(new SelectOption('', ''));
        options.add(new SelectOption('opps' ,'My Opportunities - Closing Next 30 Days' ));
        options.add(new SelectOption('open','My OPEN Opportunities - Closing Next 730 Days'));
        options.add(new SelectOption('overdue','My Overdue Opportunities'));
        options.add(new SelectOption('conv','My Converted Leads / OPPS YTD'));
        options.add(new SelectOption('proj','My Projects - Created and Owned x Vertical Market'));
        options.add(new SelectOption('x','My Accounts x Type'));
        options.add(new SelectOption('profit','Teaming for Profit - Created 2013-2014'));
        options.add(new SelectOption('commish', 'MY OPPS - LDC with WM 5% Commission'));
       
       
        return options;
     
    }
   
   
    global ID getReportID() {
        if (String.isEmpty(reportname)) { return null; }
       
       
        return reportID;
       
    }
   
    global void setReportId() { reportId= [SELECT Id FROM Report WHERE name =:reportname].id; }
   
    public PageReference choose() {
        return null;
    }
   
}

HELP!

THANKS,

Alex O

I am creating a visualforce page which will display the profile photo of the user in it.

Can someone help me reference it ?