Can anyone please help me on this issue?
On Sep 30, 11:12 am, buddi <[EMAIL PROTECTED]> wrote:
> I am using "ReportServiceStructureDemo" example to generate a report
> and here is my code
>
> import com.google.api.adwords.lib.AdWordsUser;
> import com.google.api.adwords.lib.ReportDate;
> import com.google.api.adwords.v12.DefinedReportJob;
> import com.google.api.adwords.v12.ReportInterface;
> import com.google.api.adwords.v12.ReportJobStatus;
>
> /**
> * This demo schedule structure keyword report and retrieves its
> download URL.
> */
> public class ReportServiceStructureDemo {
> public static void main(String args[]) throws Exception {
> // Log SOAP XML request and response.
> //AdWordsServiceLogger.log();
>
> // Get credentials and service
> AdWordsUser user = new AdWordsUser();
> ReportInterface service =
> (ReportInterface) user.getService(user.REPORT_SERVICE);
>
> // Create report job.
> DefinedReportJob job = new DefinedReportJob();
> /*
> job.setSelectedReportType("Structure");
> job.setAggregationTypes(new String[] {"Keyword"});
> job.setStartDay(new ReportDate(2008, 0, 1).toDate());
> job.setEndDay(new ReportDate(2008, 0, 31).toDate());
> job.setName("Demo Structure Keyword Report");
> job.setSelectedColumns(new String[] {
> "Campaign", "CampaignId", "AdGroup", "AdGroupId", "Keyword",
> "KeywordId", "MaximumCPC"});
> */
>
> job.setSelectedReportType("Creative");
> job.setAggregationTypes(new String[] {"Daily"});
> job.setStartDay(new ReportDate(2008, 7, 01).toDate());
> job.setEndDay(new ReportDate(2008, 7, 31).toDate());
> job.setSelectedColumns(new String[] {
> "CreativeId", "MaximumCPC", "CPC", "AveragePosition"});
>
> // Validate report job.
> service.validateReportJob(job);
>
> // Schedule report job.
> long jobId = service.scheduleReportJob(job);
>
> // Wait for report to finish.
> ReportJobStatus status = service.getReportJobStatus(jobId);
> while (status != ReportJobStatus.Completed &&
> status != ReportJobStatus.Failed) {
> try {
> Thread.sleep(30000);
> } catch (InterruptedException e) {}
>
> status = service.getReportJobStatus(jobId);
> System.out.println("Report job status is " + status.toString());
> }
>
> if (status == ReportJobStatus.Failed) {
> System.out.println("Job failed!");
> } else {
> System.out.println("The report is ready!");
>
> // Get report download url.
> String url = service.getGzipReportDownloadUrl(jobId);
> System.out.println("Report url is " + url);
> }
> }
>
> }
>
> The issue is, when I run this example I get a blank report. When I log
> into my AdWords account, I could see this newly generated report under
> Client Reports -> Report Center. The status says completed but when I
> click on this report, it returns a blank report (as expected). I then
> created a new report using Create Similar link next to the report
> generated using AdWords API (above) and dint change anything on
> "Create Report" page and simply clicked on Create Report button at the
> bottom. I looked at the newly created report and it is not blank which
> implies that the report I generated using AdWords API was missing
> something.
>
> Can anyone please tell me what is the issue? The above code is under
> examples of "AdWords API Java Client Library" distribution (http://
> code.google.com/p/google-api-adwords-java/).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
-~----------~----~----~----~------~----~------~--~---