Newer Version Available
List Asynchronous Runs of a Report
You can retrieve up to 2,000 instances of a report that
you ran asynchronously.
The instance list is sorted by the date and time when the report was run. Report results are stored for a rolling 24-hour period. During this time, based on your user access level, you can access results for each instance of the report that was run.
Example
You can get the instance list by calling the ReportManager.getReportInstances method. For example:
1// Get the report ID
2List <Report> reportList = [SELECT Id,DeveloperName FROM Report where
3 DeveloperName = 'Closed_Sales_This_Quarter'];
4String reportId = (String)reportList.get(0).get('Id');
5
6// Run a report asynchronously
7Reports.ReportInstance instance = Reports.ReportManager.runAsyncReport(reportId, true);
8System.debug('List of asynchronous runs: ' +
9 Reports.ReportManager.getReportInstances(reportId));