*/
public class RunReachReport {
public static void runExample(DfpServices dfpServices, DfpSession session) throws Exception {
// Get the ReportService.
ReportServiceInterface reportService = dfpServices.get(session, ReportServiceInterface.class);
// Create report query.
ReportQuery reportQuery = new ReportQuery();
reportQuery.setDimensions(new Dimension[] {Dimension.LINE_ITEM_ID, Dimension.LINE_ITEM_NAME});
reportQuery.setColumns(new Column[] {Column.REACH_FREQUENCY,
Column.REACH_AVERAGE_REVENUE, Column.REACH});
// Set the dynamic date range type or a custom start and end date that is
// the beginning of the week (Sunday) to the end of the week (Saturday), or
// the first of the month to the end of the month.
reportQuery.setDateRangeType(DateRangeType.REACH_LIFETIME);
// Create report job.
ReportJob reportJob = new ReportJob();
reportJob.setReportQuery(reportQuery);
// Run report job.
reportJob = reportService.runReportJob(reportJob);
// Create report downloader.
ReportDownloader reportDownloader = new ReportDownloader(reportService, reportJob.getId());
// Wait for the report to be ready.