Hi Joanna,
Could you email your app.config (or the line number at which the code
fails) to [email protected]? The code looks perfectly fine, so I
suspect it has something to do with the configuration settings.
Cheers,
Anash P. Oommen,
AdWords API Advisor.
On Thursday, 1 March 2012 22:05:46 UTC+5:30, Joanna wrote:
>
> Hello,
> Since two weeks ago I cannot download the AD REPORT. I am using the API
> v201109 and the .net Google.Adwords library version 14. I query using the
> following report definition
>
> Predicate campaignPredicate = new Predicate();
> campaignPredicate.field = "CampaignName";
> campaignPredicate.@operator = PredicateOperator.STARTS_WITH;
> campaignPredicate.values = new String[] { "API" };
>
> Predicate adPredicate = new Predicate();
> adPredicate.field = "AdType";
> adPredicate.@operator = PredicateOperator.EQUALS;
> adPredicate.values = new String[] { "TEXT_AD" };
>
> // Create selector.
> Selector selector = new Selector();
>
> selector.fields = new string[] {
> "Id",
> "CampaignId",
> "AdGroupId",
> "Url",
> "Description1",
> "Description2",
> "Headline",
> "DisplayUrl",
> "Status",
> "CampaignStatus",
> "AdGroupStatus"
>
> };
>
> selector.predicates = new Predicate[] { campaignPredicate,
> adPredicate };
>
> ReportDefinition reportDefinition = new ReportDefinition();
> reportDefinition.reportName = "xxxx " + DateTime.Now;
> reportDefinition.dateRangeType =
> ReportDefinitionDateRangeType.ALL_TIME;
> reportDefinition.reportType =
> ReportDefinitionReportType.AD_PERFORMANCE_REPORT;
> reportDefinition.downloadFormat = DownloadFormat.GZIPPED_CSV;
> reportDefinition.selector = selector;
>
> I get NullReferenceException. Here is the stacktrace:
>
> Exception: System.NullReferenceException: Object reference not set to an
> instance of an object.
> at
> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadReportToStream(String
>
> downloadUrl, AdWordsAppConfig config, Boolean returnMoneyInMicros, Stream
> outputStream, String postBody)
> at
> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadReportToDisk(String
>
> downloadUrl, AdWordsAppConfig config, Boolean returnMoneyInMicros, String
> path, String postBody)
> at
> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadClientReport[T](T
> reportDefinitionOrId, Boolean returnMoneyInMicros, String path)
> at
> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadClientReport[T](T
> reportDefinitionOrId, String path)
>
> I would be very gratefull if someone could help me.
> Joanna
>
>
On Thursday, 1 March 2012 22:05:46 UTC+5:30, Joanna wrote:
>
> Hello,
> Since two weeks ago I cannot download the AD REPORT. I am using the API
> v201109 and the .net Google.Adwords library version 14. I query using the
> following report definition
>
> Predicate campaignPredicate = new Predicate();
> campaignPredicate.field = "CampaignName";
> campaignPredicate.@operator = PredicateOperator.STARTS_WITH;
> campaignPredicate.values = new String[] { "API" };
>
> Predicate adPredicate = new Predicate();
> adPredicate.field = "AdType";
> adPredicate.@operator = PredicateOperator.EQUALS;
> adPredicate.values = new String[] { "TEXT_AD" };
>
> // Create selector.
> Selector selector = new Selector();
>
> selector.fields = new string[] {
> "Id",
> "CampaignId",
> "AdGroupId",
> "Url",
> "Description1",
> "Description2",
> "Headline",
> "DisplayUrl",
> "Status",
> "CampaignStatus",
> "AdGroupStatus"
>
> };
>
> selector.predicates = new Predicate[] { campaignPredicate,
> adPredicate };
>
> ReportDefinition reportDefinition = new ReportDefinition();
> reportDefinition.reportName = "xxxx " + DateTime.Now;
> reportDefinition.dateRangeType =
> ReportDefinitionDateRangeType.ALL_TIME;
> reportDefinition.reportType =
> ReportDefinitionReportType.AD_PERFORMANCE_REPORT;
> reportDefinition.downloadFormat = DownloadFormat.GZIPPED_CSV;
> reportDefinition.selector = selector;
>
> I get NullReferenceException. Here is the stacktrace:
>
> Exception: System.NullReferenceException: Object reference not set to an
> instance of an object.
> at
> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadReportToStream(String
>
> downloadUrl, AdWordsAppConfig config, Boolean returnMoneyInMicros, Stream
> outputStream, String postBody)
> at
> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadReportToDisk(String
>
> downloadUrl, AdWordsAppConfig config, Boolean returnMoneyInMicros, String
> path, String postBody)
> at
> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadClientReport[T](T
> reportDefinitionOrId, Boolean returnMoneyInMicros, String path)
> at
> Google.Api.Ads.AdWords.Util.Reports.ReportUtilities.DownloadClientReport[T](T
> reportDefinitionOrId, String path)
>
> I would be very gratefull if someone could help me.
> Joanna
>
>
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
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