private static void CreateAndRunStandardReport(DfareportingService service, long userProfileId) { DimensionValueList advertisers = new GetDimensionValuesHelper(service).Query( "dfa:advertiser", userProfileId, StartDate, EndDate, MaxListPageSize); if (advertisers.Items.Count > 0) { // Get an advertiser to report on. DimensionValue advertiser = advertisers.Items[0]; Report standardReport = new CreateStandardReportHelper(service).Insert( userProfileId, advertiser, StartDate, EndDate); // List all of the fields compatible with this standard report. new GetCompatibleFieldsHelper(service).Run(userProfileId, standardReport); File file = new GenerateReportFileHelper(service).Run(userProfileId, standardReport, true); if (file != null) { // If the report file generation did not fail, display results. new DownloadReportFileHelper(service).Run(file); } } }