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); } } }
private static void CreateAndRunFloodlightReport(DfareportingService service, long userProfileId) { DimensionValueList floodlightConfigIds = new GetDimensionValuesHelper(service).Query( "dfa:floodlightConfigId", userProfileId, StartDate, EndDate, MaxListPageSize); if (floodlightConfigIds.Items.Count > 0) { // Get a Floodlight Config ID, so we can run the rest of the samples. DimensionValue floodlightConfigId = floodlightConfigIds.Items[0]; Report floodlightReport = new CreateFloodlightReportHelper(service).Insert( userProfileId, floodlightConfigId, StartDate, EndDate); File file = new GenerateReportFileHelper(service).Run(userProfileId, floodlightReport, false); if (file != null) { // If the report file generation did not fail, display results. new DownloadReportFileHelper(service).Run(file); } } }