Changes to filters that are made through the API don’t affect the source report definition. Using the API, you can filter with up to 20 custom field filters and add filter logic (such as AND and OR). But standard filters (such as range), filtering by row limit, and cross filters are unavailable.
Before you filter a report, it’s helpful to check the following filter values in the metadata.
You can filter reports during synchronous or asynchronous report runs.
// Get the report ID List <Report> reportList = [SELECT Id,DeveloperName FROM Report where DeveloperName = 'Closed_Sales_This_Quarter']; String reportId = (String)reportList.get(0).get('Id'); // Get the report metadata Reports.ReportDescribeResult describe = Reports.ReportManager.describeReport(reportId); Reports.ReportMetadata reportMd = describe.getReportMetadata(); // Override filter and run report Reports.ReportFilter filter = reportMd.getReportFilters()[0]; filter.setValue('2013-11-01'); Reports.ReportResults results = Reports.ReportManager.runReport(reportId, reportMd); Reports.ReportFactWithSummaries factSum = (Reports.ReportFactWithSummaries)results.getFactMap().get('T!T'); System.debug('Value for November: ' + factSum.getAggregates()[0].getLabel()); // Override filter and run report filter = reportMd.getReportFilters()[0]; filter.setValue('2013-10-01'); results = Reports.ReportManager.runReport(reportId, reportMd); factSum = (Reports.ReportFactWithSummaries)results.getFactMap().get('T!T'); System.debug('Value for October: ' + factSum.getAggregates()[0].getLabel());