• Using Ananlytics API in Apex with the help of Reports.ReportsManager Object and its methods, I am retrieving data from a report.

  • when I try to run the report using the following :-

Reports.ReportInstance instance = Reports.ReportManager.runAsyncReport(reportId,reportMd, true); System.debug('Asynchronous instance: ' + instance); //Get the Async report instance results Reports.ReportInstance instance1 = Reports.ReportManager.getReportInstance(instance.getId()); Reports.ReportResults results = instance1.getReportResults();

I am getting the following error while loading on Page :

"Content cannot be displayed. The report results aren't available because the instance has not finished running."

1 Answer 1


believe you are trying to get the report results before the report is fully run. since you are using runAsyncReport method you have to do kind of polling on the report status and get the results once its run.. this blog from Peter Knolle has code sample on using async http://peterknolle.com/asynchronous-reports-with-the-analytics-api-in-apex/

the other option is to use one of the runReport synchronous methods in the ReportManager class. http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_class_reports_reportmanager.htm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .