I have written code for getting reports, but I am getting exception  * Customer 
can not create report of a selected type.. (Error: 
ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH, FieldPath: 
selector.reportDefinition, Trigger: ). *

code is below

 ReportDefinition definition = new ReportDefinition()
            {
                reportName = "Last 7 days CRITERIA_PERFORMANCE_REPORT",
                reportType = 
ReportDefinitionReportType.CRITERIA_PERFORMANCE_REPORT,
                downloadFormat = DownloadFormat.XML,
                dateRangeType = ReportDefinitionDateRangeType.LAST_7_DAYS,

                selector = new Selector()
                {
                    fields = new string[] 
                    {"CampaignId", "AdGroupId", "Id", "CriteriaType", 
"Criteria",
                        "FinalUrls", "Clicks", "Impressions", "Cost"
                    },
                    predicates = new Predicate[] 
                    {
                        Predicate.In("Status", new string[] {"ENABLED", 
"PAUSED"})
                    }
                },
            };

            (user.Config as AdWordsAppConfig).IncludeZeroImpressions = true;

            string filepath = Server.MapPath("data.xml");
            try
            {
                ReportUtilities utilities = new 
ReportUtilities(user,"v201609",definition);
                using (ReportResponse response = utilities.GetResponse())
                {
                    response.Save(filepath);
                }
                Response.Write("Report downloaded"+ filepath);
            }
            catch(Exception ex)
            {
                string a = ex.Message;
            }


I am not able to understand where I am going wrong please help me.

Any help appreciated.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/fc8c9ccb-0472-4af4-a0b2-b74ae17cec63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • Customer can no... Vinayaka N
    • Re: Custom... 'Shwetha Vastrad (AdWords API Team)' via AdWords API Forum

Reply via email to