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.LINE_ITEM_ID});
reportQuery.setColumns(new Column[] {Column.AD_SERVER_IMPRESSIONS});
// Set the dynamic date range type or a custom start and end date.
reportQuery.setDateRangeType(DateRangeType.LAST_MONTH);
// Set the custom field IDs.
reportQuery.setCustomFieldIds(new long[] {customFieldId});
// Create report job.
ReportJob reportJob = new ReportJob();
reportJob.setReportQuery(reportQuery);