You probably know this, but if the reports were originally defined in the
UI, they will not be available via the API. Apart from that, I can't offer
any help but I'd recommend using ad hoc reports instead of the
ReportDefinitionService (which will be deprecated anyway).
Cheers
On Monday, July 16, 2012 8:48:00 PM UTC+2, road11 wrote:
>
> Using the C# v201109_1 code samples as a model, I'm trying to download one
> of our many previously defined and named reports. Here's the code that
> Google gave us to get our report definitions that isn't working (assuming a
> valid AdwordsUser object)...
>
>
> ReportDefinitionService reportDefinitionService =
> (ReportDefinitionService) user.GetService(
> AdWordsService.v201109_1.ReportDefinitionService);
>
> // Create the selector.
> ReportDefinitionSelector selector = new ReportDefinitionSelector();
>
> try {
> // Get all report definitions.
> ReportDefinitionPage page = reportDefinitionService.get(selector);
>
> // Display report definitions.
> if (page != null && page.entries != null && page.entries.Length > 0) {
> foreach (ReportDefinition reportDefinition in page.entries) {
> writer.WriteLine("ReportDefinition with name \"{0}\" and id
> \"{1}\" was found.",
> reportDefinition.reportName, reportDefinition.id);
> }
> } else {
> writer.WriteLine("No report definitions were found.");
> }
>
> } catch (Exception ex) {
> throw new System.ApplicationException("Failed to retrieve report
> definitions.", ex);
> }
>
>
> ...however, this code keeps telling me that page.entries is null. We've got
> at least 1400 named reports defined in this Google Adwords account. How is it
> possible that this code can find none of them? I thought the selector might
> be the problem, but the ReportDefinitionSelector doesn't even have a fields
> property, so that can't be the issue.
>
>
> I would be most grateful if someone could post a (working) C# example of how
> to get a list of available reports and how to download a single named report
> from an Adwords account.
>
>
> Thank you in advance.
>
>
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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