*/
public class RunMergedDeliveryReport {
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.DATE, Dimension.ORDER_ID, Dimension.ORDER_NAME});
reportQuery.setColumns(new Column[] {Column.MERGED_AD_SERVER_IMPRESSIONS,
Column.MERGED_AD_SERVER_CLICKS, Column.MERGED_AD_SERVER_CTR,
Column.MERGED_AD_SERVER_CPM_AND_CPC_REVENUE,
Column.MERGED_AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM});
// Set the dynamic date range type or a custom start and end date.
reportQuery.setDateRangeType(DateRangeType.LAST_MONTH);
// 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.