"Impressions",
"Clicks",
"Cost"));
// Create report definition.
ReportDefinition reportDefinition = new ReportDefinition();
reportDefinition.setReportName("Criteria performance report #" + System.currentTimeMillis());
reportDefinition.setDateRangeType(ReportDefinitionDateRangeType.YESTERDAY);
reportDefinition.setReportType(ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT);
reportDefinition.setDownloadFormat(DownloadFormat.CSV);
// Enable to allow rows with zero impressions to show.
reportDefinition.setIncludeZeroImpressions(true);
reportDefinition.setSelector(reportSelector);
ReportDownloadResponse response =
new ReportDownloader(session).downloadReport(reportDefinition);
if (response.getHttpStatus() == HttpURLConnection.HTTP_OK) {
FileOutputStream fos = new FileOutputStream(new File(reportFile));