public static function makeReportDataProviderAndResolveAttributeName($id, $pageSize, &$attributeName)
 {
     assert('is_int($pageSize)');
     $savedReport = SavedReport::getById($id);
     $report = SavedReportToReportAdapter::makeReportBySavedReport($savedReport);
     foreach ($report->getDisplayAttributes() as $key => $displayAttribute) {
         if ($displayAttribute->getAttributeIndexOrDerivedType() == 'id') {
             $attributeName = ReportResultsRowData::resolveAttributeNameByKey($key);
             break;
         }
     }
     if ($attributeName == null) {
         $moduleClassName = $report->getModuleClassName();
         $modelClassName = $moduleClassName::getPrimaryModelName();
         $displayAttribute = new DisplayAttributeForReportForm($moduleClassName, $modelClassName, $report->getType());
         $displayAttribute->attributeIndexOrDerivedType = 'id';
         $report->addDisplayAttribute($displayAttribute);
         $attributeName = ReportResultsRowData::resolveAttributeNameByKey($key + 1);
     }
     return ReportDataProviderFactory::makeByReport($report, $pageSize);
 }
 /**
  * @param $key
  * @return string
  */
 public function resolveAttributeNameForGridViewColumn($key)
 {
     assert('is_int($key)');
     $modelToReportAdapter = $this->makeResolvedAttributeModelRelationsAndAttributesToReportAdapter();
     if ($modelToReportAdapter->isDisplayAttributeMadeViaSelect($this->getResolvedAttribute())) {
         return $this->columnAliasName;
     }
     return ReportResultsRowData::resolveAttributeNameByKey($key);
 }