I'm trying to sort by date when defining and adding a report.
$selector->fields = array('CampaignId', 'CampaignName', 'Status', 'Clicks', 'Cost', 'Date');
$selector->ordering = array('Date'); // Is this correct?
$reportDefinition = new ReportDefinition();
$reportDefinition->reportName = 'name';
$reportDefinition->dateRangeType = 'LAST_7_DAYS';
$reportDefinition->reportType = 'CAMPAIGN_PERFORMANCE_REPORT';
$reportDefinition->downloadFormat = 'XML';
$reportDefinition->selector = $selector;
I suspect there's more to it. Thanks.