// Create report job.
ReportJob reportJob = new ReportJob();
// Create report query.
ReportQuery reportQuery = new ReportQuery();
reportQuery.setDateRangeType(DateRangeType.LAST_WEEK);
reportQuery.setDimensions(new Dimension[] {Dimension.DATE, Dimension.AD_UNIT_NAME});
reportQuery.setColumns(new Column[] {Column.AD_SERVER_IMPRESSIONS,
Column.AD_SERVER_CLICKS, Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_IMPRESSIONS,
Column.DYNAMIC_ALLOCATION_INVENTORY_LEVEL_CLICKS,
Column.TOTAL_INVENTORY_LEVEL_IMPRESSIONS,
Column.TOTAL_INVENTORY_LEVEL_CPM_AND_CPC_REVENUE});
reportQuery.setAdUnitView(ReportQueryAdUnitView.HIERARCHICAL);
reportJob.setReportQuery(reportQuery);
// Run report job.
reportJob = reportService.runReportJob(reportJob);