+ Start a Discussion
bharath kumar 52bharath kumar 52 

Not able to fetch report id through select query but getting it in anonymous apex

Hi All,

I am working on a requirement where i am using report ids i.e report ids are hardcoded.
<analytics:reportChart reportId="00O28000006Uvr3" size="small" ></analytics:reportChart>
I need to get remove this hardcoding and get it from select query. How can i accomplish this?

Thanks,
Bharath
 
Andrew EchevarriaAndrew Echevarria
In your controller, you can create a getter function:
public getDynamicId(){
   // SOQL, all the operations you need to get the id
   return dynamidId;
}

Then, in your reportChart you would set it to the getter:
<analytics:reportChart reportId="{!DynamicId}" size="small" ></analytics:reportChart>