// Run report job.
reportJob = reportService.runReportJob(reportJob);
// Create report downloader.
final ReportDownloader reportDownloader =
new ReportDownloader(reportService, reportJob.getId());
reportDownloader.whenReportReady(new ReportCallback() {
public void onSuccess() {
try {
// Change to your file location.
String filePath = File.createTempFile("async-report-", ".csv.gz").toString();
System.out.printf("Downloading report to %s ...", filePath);
// Download the report.
reportDownloader.downloadReport(ExportFormat.CSV_DUMP, filePath);
System.out.println("done.");
} catch (IOException e) {
e.printStackTrace();
}